Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
prototype18
Starting Member
7 Posts |
Posted - 2010-10-08 : 13:36:12
|
I need to make an auto increment primary key field in one of my tables, so I tried setting up the Identity Specification but it will not allow me to change the setting from NO to YES. I have tried just about every common sense approach but no success.So I re-created the table from scratch with no data, and I still cannot declare or set the identity specification on that specific field, primary key or not.Any help would be greatly appreciated. THANKS! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
prototype18
Starting Member
7 Posts |
Posted - 2010-10-08 : 13:46:03
|
CREATE TABLE [dbo].[tbreso]( [ITEM] [varchar](6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [OWN_1] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [OWN_2] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [OWN_4] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PROP_1] [varchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PROP_2] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PROP_ZIP] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [KEYFIELD] [char](21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [KEY_T_B_RESO] [int identity (1, 1)] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [CC_] [char](6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)Its failing on the int identity... |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
prototype18
Starting Member
7 Posts |
Posted - 2010-10-08 : 13:51:05
|
CREATE TABLE [dbo].[tbreso]( [ITEM] [varchar](6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [OWN_1] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [OWN_2] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [OWN_4] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PROP_1] [varchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PROP_2] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PROP_ZIP] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [KEYFIELD] [char](21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [KEY_T_B_RESO] [int identity] (1,1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [CC_] [char](6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,)Still failing.Msg 156, Level 15, State 1, Line 12Incorrect syntax near the keyword 'COLLATE'. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|