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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Add column to a table

Author  Topic 

landau66
Yak Posting Veteran

61 Posts

Posted - 2008-06-17 : 04:43:15
Hello everyone!

I want to add a column to a existing table.
How would be the TSQL command for that, and how is it to make this new column a primary key with auto values.

thanks in advance and greeting from vienna

landau66

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2008-06-17 : 04:46:53
[code]

Alter Table YourTable
Add Id Int Identity(1,1) Primary Key
[/code]

Chirag

http://www.chirikworld.com
Go to Top of Page
   

- Advertisement -