SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Design Errors : PK's with multiple columns on table with identity

By Doran Mackay,

Run the code.

If there are results, script out the tables and have a look at the identity and the PK structure

If the PK contains the identity column and has extra columns, considering that an identity should be unique, consider altering the table to recreate the PK only on the identity.

Is_primary is optional and can be added or removed from the filter to find all indexes which contain the identity column or only the primary keys which contain the identity

There may have been a misunderstanding and there may have been a need to create a unique constraint on the extra columns, or they may be valid reasons why the choice was made, but this tool is for investigation first.

Anyway, ask the devs what the intent was and always test before pressing F5.

Total article views: 118 | Views in the last 30 days: 2
 
Related Articles
FORUM

identity column

identity column

FORUM

Issues in Identity Column

Issues in Identity Column

FORUM

Populating SQL table - problem w/populating Identity column

Parent table doesn't contains Identity column Where as new one has an identity column

FORUM

Identity column value should not be increased if there's pbm in insertion of record.

Identity column value should not be increased if there's pbm in insertion of record.

FORUM

Identity column

Is identity column a good idea?

Tags
 
Contribute