Help with Alter Table Alter Column 
Author Message
 Help with Alter Table Alter Column
I would like to use the "Alter Table Table1 Alter Column Field1" syntax to
turn the IDENTITY property to 'yes'  and seed/increment (1,1).

Can anybody out there help me out?

Thanks

Greg



Mon, 08 Sep 2003 02:10:13 GMT
 Help with Alter Table Alter Column

    You can't add the IDENTITY property to an existing column using ALTER
TABLE. You have to drop & re-create the column like:

BEGIN TRAN
ALTER TABLE tbl DROP COLUMN idCol
ALTER TABLE tbl ADD idCol int IDENTITY
COMMIT

--
Umachandar Jayachandran
SQL Resources at http://www.umachandar.com/resources.htm
( Please reply only to newsgroup. )



Mon, 08 Sep 2003 02:21:12 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. multiple ALTER COLUMNs in one ALTER TABLE statement?

2. Alter Table Alter Column Syntax

3. Alter table alter column

4. alter table alter column

5. Alter table alter column syntax

6. Alter table Alter column problem.

7. ALTER TABLE ... ALTER COLUMN IDENTITY

8. ALTER TABLE ALTER COLUMN

9. ALTER TABLE ALTER COLUMN to set Default

10. Alter table alter column text

11. syntax for ALTER TABLE ALTER COLUMN DEFAULT

12. Errors With ALTER TABLE/ALTER COLUMN


 
Powered by phpBB® Forum Software