jrspano
asked on
copy table definition
I need a sql statement that copies a table with all related stuff EXACLTY, but without the data to a new table name. I has to work in sql server 7 and 2000 and must bring permissions and preferably indexes, defaults, etc with it.
Thanks in advance.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
see if this helps
create table t1(select * from mytable where 1=2)
t1- is the new table
mytable-is the table who's copy u want
this will copy the structure alone without any data
create table t1(select * from mytable where 1=2)
t1- is the new table
mytable-is the table who's copy u want
this will copy the structure alone without any data
ASKER
thanks for all your input but unfortunatly it wont produce any dynamic output. the script is static to my database. I need something dynamic that will take a table I tell it to and make another table with the same table structure and permissions.
ASKER
i ended up using this, and not needing the user definitions. thanks
Cheers