Unique Index Problem


Author
Message
Aaron Young
Aaron Young
StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi,

I have a ROWGUID field and index in every table in a SQL Server 2005 database. The indexes are unique and non-clustered and all indexes and fields are called the same - ROWGUID. This database is pre-StrataFrame so I am trying to setup the model in DDT to match it.

After I set the Unique property on the ROWGUID indexes (see attached screenshot), when I try and deploy a new database, it will only create the index on the first table and for all other tables the DDT reports the error:-

"There is already an object named 'ROWGUID' in the database. Could not create constraint."

When the Unique property is set, it looks like the DDT wants the indexes to be called different names. When the Unique property is reset it will create the indexes albeit as non-unique.

SQL Server doesn't need a Unique index to have a unique name so I was wondering if I have missed something?

Aaron

Attachments
Index.png (196 views, 25.00 KB)
Replies
Aaron Young
Aaron Young
StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi Dustin,

As SQL Server allows it then it would be great if the DDT allowed it too. I have come up with a workaround in the meantime by using a database schema comparison tool so it isn't a big problem.

Thanks,

Aaron

Aaron Young
Aaron Young
StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi Guys,



Just thought I would bump this one as it came back to haunt me today. Just to summarise the above I have a unique index called ROWGUID in each table and when I try and make this a unique index in the DDT, it always creates the indexes as non-unique. I only want to create them as indexes and not constraints.



I know there was some discussion above on whether a unique index should also have a unique name, but to quote Microsoft:-



"Index names must be unique within a table, but do not have to be unique within a database."



I am not sure this is actually the problem - it could be nothing more than the Unique index flag is not working. To date, I have had to run another database schema tool after the DDT package has run to correct the problem and today I forgot Sad Hence the bump.



Thanks,



Aaron
Trent Taylor
Trent Taylor
StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I guess I need more information then because I cannot get SQL Server to allow this.  The DDT actually let's you create the index names.  But SMO is preventing them from being distributed this way.  I will need a sample package and more details to work this this issue.  I am more than willing to add anything that falls within the support of SQL Server 2005 or greater if supported by these versions.  But at the moment, I am not understanding what you are trying to do apparently.
Aaron Young
Aaron Young
StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)StrataFrame User (349 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I will send you a SQL script shortly that will create a full database to show the problem.



Thanks
Trent Taylor
Trent Taylor
StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)StrataFrame Developer (8.7K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Got it. Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Aaron Young - 16 Years Ago
Greg McGuffey - 16 Years Ago
Aaron Young - 16 Years Ago
Greg McGuffey - 16 Years Ago
Aaron Young - 16 Years Ago
Dustin Taylor - 16 Years Ago
Aaron Young - 16 Years Ago
Aaron Young - 15 Years Ago
Trent L. Taylor - 15 Years Ago
                         I will send you a SQL script shortly that will create a full database...
Aaron Young - 15 Years Ago
                             Got it. :)
Trent L. Taylor - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search