Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create table syntax

Status
Not open for further replies.

DanAuber

IS-IT--Management
Apr 28, 2000
255
0
0
FR
The following would work in Oracle (I think) - what would the syntax be in SQL Server SQL ??

Create table xxx as (select * from yyyy);

yyyy being an existing table with data in it

Thanks for any help





Dan Auber
DanAuber@aol.com
 
create table xxx( <define your structure> )

insert xxx
SELECT * from yyy

? br
Gerard
(-:

Better a known bug then a new release.


| Do it!
|
V
 
[tt]select *
into MyNewTable
from MyExistingTable [/tt]

This allows you to do it all in one step. You can add an optional WHERE clause if desired. The destination table must not exist. Robert Bradley
teaser.jpg

 
One warning about using foxdev's &quot;select into&quot; idea. A select into statement will lock the table you are selecting from until the operation is complete, so I recommend doing that afterhours. If you can't wait, then create the table and just append into it, as suggested by foxbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top