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 |
rwaldron
Posting Yak Master
131 Posts |
Posted - 2006-09-04 : 06:17:44
|
Hi all,I have a table that gets created from a query using Select * INTO Table_Name.How do I also add an autonumber column to this table ?I know how to create the field using create table command ie:CREATE TABLE t_test( id INTEGER IDENTITY PRIMARY KEYBut I can't use create table as I need the table populated from query results.. So I need to use Select INTOAny help please.Thx,Ray. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-04 : 06:22:52
|
Select name, rowidcol = identity(int, 1,1) INTO Table_Name from master..spt_valuesPeter LarssonHelsingborg, Sweden |
|
|
rwaldron
Posting Yak Master
131 Posts |
Posted - 2006-09-04 : 06:58:01
|
Thx a million,that workedRay.. |
|
|
|
|
|