copy fields from one table to the field structure of another table

  • Thread starter Thread starter Educo Gent
  • Start date Start date
E

Educo Gent

How can I copy fields (not records) from one table to the field structure of
another table (in the same database on a sql server 2000)? So that I have
not to re-type the name and properties of the fields and to be sure the name
and properties of the fields are the same in both tables.

Thanks,
Hugo
 
Here is one way.

From SQL Enterprise Manager, right click the table. Select all tasks,
generate sql script.

In the options tab, check script indexes, triggers, and primary keys. For
the file format, choose Windows text (ANSI)

Press OK, save the sql file and edit it with notepad to remove name
conflicts. Run the resulting SQL from query analyzer.
 
If you are not interested with things like Indexes, then a simple Copy&Paste
in design mode will fill the bill. To activate the Past, make sure to
select a row and not only a cell.

S. L.
 
Back
Top