Rank: Newbie Groups: Member
Joined: 2/18/2007 Posts: 2 Points: 0
|
hi
I need to change the Identity Specification (Identity Seed 1, Identity Increment 1)on a column with data already on it, Ive tried clicking on modify, properties and extend properties. for some reason you cant change it
I notice when you make a new column you can change the Identity Specification however when I do this I can't copy data in to it.
thanks dave
|
Rank: Administration Groups: Administration
Joined: 9/11/2006 Posts: 605 Points: 649 Location: Enghien Les Bains, France
|
Unfortunately, there is no easy way to modify identity specification as there is no SP or T-SQL that would allow modifying these properties. You can define these properties while creating the column. In order to copy data on an indentity column you must use the SET IDENTITY_INSERT tblName ON command. Example: Code:SET IDENTITY_INSERT [dbo].[Company] ON
INSERT INTO [dbo].[Company] ([id], [Name], [Address], [Address2], [ZipCode], [City], [State], [Country], [Phone], [Web]) VALUES (1, 'Acme Inc.', '102 st. WE', NULL, '001-0023', 'New York', NULL, 'United States', NULL, 'http://www.acme.net')
SET IDENTITY_INSERT [dbo].[Company] OFF
Hope this helps
|