Object names containing [ or ] symbols
Yuri
Posts: 6
I have encountered a small bug: when object name contains symbols [ or ] it is scripted incorrectly.
In my case there was a constraint names like "n1].[n2" (I know that's not a great ide to use name like that, but it just happened this way).
Then database compare script was created like this:
...CONSTRAINT [n1].[n2] DEFAULT...
which cannot be accepted by SQL server, it should have been
...CONSTRAINT [n1]].[n2] DEFAULT...
or
...CONSTRAINT "n1].[n2" DEFAULT...
Yuri
In my case there was a constraint names like "n1].[n2" (I know that's not a great ide to use name like that, but it just happened this way).
Then database compare script was created like this:
...CONSTRAINT [n1].[n2] DEFAULT...
which cannot be accepted by SQL server, it should have been
...CONSTRAINT [n1]].[n2] DEFAULT...
or
...CONSTRAINT "n1].[n2" DEFAULT...
Yuri
Comments
Thanks for pointing this out. I have logged an issue for our developers to look at with a reference number of SC-3866. If we can support identifiers in a future version, we will look into that.
Thanks!