Re: altering a column of a table
From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 01/03/05
- Next message: avnrao: "Re: altering a column of a table"
- Previous message: J. M. De Moor: "Re: Help with a trigger (or procedure)"
- In reply to: Eitan: "altering a column of a table"
- Next in thread: avnrao: "Re: altering a column of a table"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 Jan 2005 09:16:48 -0000
I suggest that ALL changes on a live system should be made through SQL
scripts rather than using Enterprise Manager / Wizards. That way you can
more reliably reproduce and test your installation process.
IDENTITY is the correct name for the "auto-incrementing" column property in
SQL Server.
You can ADD an IDENTITY column to a table using an ALTER TABLE statement:
ALTER TABLE YourTable ADD col INTEGER IDENTITY
You cannot add the IDENTITY property to an existing column. Enterprise
Manager achieves this by creating a new table with IDENTITY, repopulating it
with the old data and then dropping the old table. That's something you may
want to avoid doing on a production system. If you do want to use that
approach then use Enterprise Manager to change the column on a development
copy of your data and select the Save Change Script option to save the
commands to a file. That way you can see exactly what the steps are.
-- David Portas SQL Server MVP --
- Next message: avnrao: "Re: altering a column of a table"
- Previous message: J. M. De Moor: "Re: Help with a trigger (or procedure)"
- In reply to: Eitan: "altering a column of a table"
- Next in thread: avnrao: "Re: altering a column of a table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|