Brackets in name causes difference

StevenDStevenD Posts: 3
edited March 29, 2006 10:21AM in SQL Compare Previous Versions
Hi,

I'm currently testing SqlCompare v4. I've noticed Sql Compare lists some tables as different although the only difference is that their names are enclosed in brackets on one db and not on the other. (eg. [dbo].[MyTable] vs dbo.MyTable). Note that this only occurs for a few tables (4 out of 50 or so). I've looked for an option to ignore brackets, but I haven't found anything. Is there a solution for this?

thanx

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello Steven,

    There isn't a way to ignore the identifiers of SQL objects. I haven't seen this behaviour before -- which database platform is this? SQL 2005?
  • Yes, both databases are running on SQLServer 2005 (on separate machines)

    After experimenting some more, I found out that whether the problem occurs or not, depends on how the tables (or in my case it were views) are made. If you make a table from within SQL server Management Studio, the square brackets are *not* added. So if I make a view called TEST, Sql Compare will treat it as:

    CREATE VIEW TEST
    AS
    ...

    If you generate a create script from within SqlServer Mgmt Studio, it will add the brackets (and the schema):
    CREATE VIEW [dbo].[TEST]
    AS
    ...

    If then use this script to update the 2nd database and compare the two databases, Sql Compare will report them as different. So it seems as if Sql Compare uses the exact string that is used to create the database...

    Hope this helps,

    Steven
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Steven,

    I had a suspicion that was it. There are many posts about this very same topic in the forum already. It appears that the problem is too complicated to fix anytime soon. SQL 2005 is adding these identifiers automatically.
Sign In or Register to comment.