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 |
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-04-05 : 10:59:03
|
| I need to end up with CalID as a primary key identity field?Drop table dbo.Cal5CSelect Top 673 IDENTITY (int, 1, 1) As CalID ,CLdate,Shift,Schday,Workdate,0 as Job_number_link into dbo.Cal5CFrom CalendarSchWhere CLdate > Getdate()Order by CLdateAny Ideas ?JimUsers <> Logic |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-04-05 : 11:06:36
|
Jim, just use a CREATE TABLE statement. You know better than this. Come on man.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
rfrancisco
Yak Posting Veteran
95 Posts |
Posted - 2005-04-05 : 11:10:23
|
| Or you can issue the statement that will make CalID the Primary Key after this as follows:ALTER TABLE Cal5C ADD CONSTRAINT PK_Cal5C PRIMARY KEY (CalID) |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-04-05 : 11:16:48
|
| Yea I know derrick.But I rairly mess with tables structure via SP.One of the pitfalls of using GUI.Geese My brains fried.Spent all night up with back pains.Thanks rfrancisco that was what I was After. JimUsers <> Logic |
 |
|
|
|
|
|