What i m looking for is to duplicate a table.
The complicate part is to get the table script (which includes also the relationships) with a query and not using the Script Table as - CREATE To.
Any ideas?
What i m looking for is to duplicate a table.
The complicate part is to get the table script (which includes also the relationships) with a query and not using the Script Table as - CREATE To.
Any ideas?
This will suffice for columns, datatypes and nulability:
select top 0 *
into destination_table
from source_table
For keys, constraints, indexes, triggers and other stuff you'll still have to use information_schema/sys tables