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
 Selecting an existing table into a new table

Author  Topic 

mdeynarian
Starting Member

1 Post

Posted - 2009-03-31 : 17:11:52
I am trying to select an existing table into a new table, which will have an additional field within the existing fields. Can someone give the syntax for this? Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-31 : 17:14:25
SELECT Column1, Column2, 999 AS NewColumn
INTO NewTable
FROM ExistingTable

Or if NewTable already exists, use INSERT/SELECT.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -