Interview Question in SQL Server Clustering


 

Interview Question :: Why do i get erro when alter table command in ms sql 2000


hi,
i have created this table in ms sql 2000

CREATE TABLE [Cmm_Category] (
[CatID] [int] IDENTITY (1, 1) PRIMARY KEY CLUSTERED NOT NULL ,
[CatName] [nvarchar] (50) NULL ,
[CatImage] [varchar] (50) NULL ,
[CatFolder] [nvarchar] (50) NULL ,
[Active] [bit] default (1) NULL
) ON [PRIMARY]
GO

but when i export it to my remote server the index of catid is removed and when i try to modify the table with the syntax below i get erro
Incorrect syntax near '('

alter TABLE [Cmm_Category] Modify (
[CatID] [int] IDENTITY (1, 1) PRIMARY KEY CLUSTERED NOT NULL ,
[CatName] [nvarchar] (50) NULL ,
[CatImage] [varchar] (50) NULL ,
[CatFolder] [nvarchar] (50) NULL ,
[Active] [bit] default (1) NULL
) ON [PRIMARY]
GO
Answers to "Why do i get erro when alter table command in ms sql 2000"
RE: Why do i get erro when alter table command in ms sql 2000?

Alter table Cmm_Category Drop Column CatID



Alter table CMM_Category Add Column CatID int Identity (1,1)



This should work.
 
Vote for this answer ::  
Update Alert Setting