Unique Index Problem


Author
Message
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 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 (342 views, 25.00 KB)
Replies
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi Greg,

The production database I am trying to duplicate in DDT has been in use for years and is currently installed with many customers in SQL Server 2005. SQL Server 2005 doesn't require a unique name for a unique index in our model as the two attached screenshots hopefully demonstrate.

Basically, I am trying to build an application on top of our existing production database and I only noticed the problem when a database schema tool reported that the DDT generated indexes were not set as unique. I changed this and immediately hit the problem.

I appreciate that I could change the name of every field but our customers have this database currently installed in around several thousand SQL 2005 instances and to upgrade them would be painful when all I really want to do is to have the DDT generate the same database that we are already using.

Aaron

Attachments
Table1.png (358 views, 27.00 KB)
Table2.png (374 views, 28.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I stand corrected. It looks like an index has to be unique by table, but not for the entire DB. Interestingly, I tested this and it works if I write the SQL directly, but doesn't like it when using SSMS. For this reason, I've always just created unique index names. So, I think this is one that the SF team is going to have to answer. Sorry Ermm
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I think the DDT is trying to create it as a unique constraint rather than a unique index - at least that is what the error message and behaviour suggest.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




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

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search