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 |
Htwe Htwe
Starting Member
9 Posts |
Posted - 2013-07-27 : 00:57:29
|
Hello SqlTeam,I have created a table and want to alter that table.I want to add identity to my existence column.How to add identity to my existence column?Thanks in advanceHtwe Htwe |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-07-27 : 02:15:23
|
ALTER TABLE dbo.Table1 ADD pkCol INT IDENTITY(1, 1) PRIMARY KEYALTER TABLE dbo.Table1 ADD pkCol INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
Htwe Htwe
Starting Member
9 Posts |
Posted - 2013-07-27 : 03:06:52
|
Hello,I did ALTER TABLE statements.I got error like this--Column names in each table must be unique. Column name 'student_id' in table 'dbo.student' is specified more than once.May I know about it.Thanks in advanceHtwe Htwe |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-07-27 : 03:28:42
|
If you already have an unique column, you will have to go with visakhs suggestion. Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
Htwe Htwe
Starting Member
9 Posts |
Posted - 2013-07-27 : 03:44:39
|
Yes.Thanks a lotThanks and RegardsHtwe Htwe |
|
|
|
|
|
|
|