Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Identity Issue


Identity Issue

Author
Message
OnlyOneRJ
OnlyOneRJ
Old Hand
Old Hand (300 reputation)Old Hand (300 reputation)Old Hand (300 reputation)Old Hand (300 reputation)Old Hand (300 reputation)Old Hand (300 reputation)Old Hand (300 reputation)Old Hand (300 reputation)

Group: General Forum Members
Points: 300 Visits: 690
I have a Table where in i have to set Identity in it.... it has 1 Lakh records in it..
when i go to design mode of the table & try to set the Identity to YES... it gives the below error

w00t
'Record_1' table
- Saving Definition Changes to tables with large amounts of data could take a considerable amount of time. While changes are being saved, table data will not be accessible.
- Warning: One or more existing columns have ANSI_PADDING 'off' and will be re-created with ANSI_PADDING 'on'.

w00t

Please help

************************************
Every Dog has a Tail !!!!! :-D
Gazareth
Gazareth
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2872 Visits: 5351
You can't add an Identity property to an existing field.
So the way the GUI will do that is:
Create a new table that does have the column with Identity property
Copying the data across from old table to new.
Delete old table
Rename new table & associated constraints (FK's etc.) to the original names.

While it's doing this, the tables will be locked so you can't make any data modifications.

If you hit the Generate Change Script button rather than save, you can see the script that does all of the above.

The ANSI Padding warning is because the new table will be created with SET ANSI_PADDING ON, whereas some or all of the old table columns were created with it off. Probably a good idea to move to ON (as OFF is being removed from SQL), but check on the difference in behaviour of the two and see if it affects you.

You can script out & do this manually, which will give you more control on how long the table is unavailable.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search