Hi,
I have a table of data and would like to make an exact copy of the table (structure and data).
Are there any ways to do this without having to first run a create statement (that would have been based on the original table being manually scripted) and then select insert for the data. The reason being that this initial table may change and that would mean I would have to go and change my create statements. It would be nice to have a blind command:-
create table A based on table B
etc
Thanks
Rhys
Rhys,
The SELECT INTO command may work for you.
here is an example
CREATE Table B ( i int primary key )
INSERT into B values(1)
INSERT into B values(2)
SELECT * INTO A from B -- this creates table A
Karl Tarbet
|||Thanks Karl, that was exactly what I was looking for.
No comments:
Post a Comment