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!

Where do the SQL create scripts come from?

Status
Not open for further replies.

timfoster

Programmer
Dec 19, 2002
110
0
0
GB
I think I may be missing something really obvious here. I want to create a copy of a table without the data. The tables are dynamic and so I can't look at a given column and do WHERE ID = -1 or something similar. Some of the tables may be very large. What I'd like to do is effectively run a create table script with a different name. The indexes, pk's etc aren't relevant for this purpose so I'm not interested in creating them. I guess I could read sys.columns and build a script from that, but is there a better way?
 
Code:
select * into newtable from oldtable where 1 = 2

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Ah, of course!!! Thanks djj55. I've obviously been having a blonde moment!
 
It happens

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top