Using INSERT to copy a table
-
Have several tables on SQL Server from a Web Hoster. I have no way of actually coping the tables. So using INSERT SELECT I thought I could just copy the entire table to tableName2 for back up. I tried INSERT Category2 SELECT * FROM Category But it wants the table already defined. I know theres a way to create the table in the statement also. Can anyone help. Thanks, Nick 1 line of code equals many bugs. So don't write any!!
-
Have several tables on SQL Server from a Web Hoster. I have no way of actually coping the tables. So using INSERT SELECT I thought I could just copy the entire table to tableName2 for back up. I tried INSERT Category2 SELECT * FROM Category But it wants the table already defined. I know theres a way to create the table in the statement also. Can anyone help. Thanks, Nick 1 line of code equals many bugs. So don't write any!!
SELECT * INTO Category2 FROM Category
---------- There go my people. I must find out where they are going so I can lead them. - Alexander Ledru-Rollin -
Have several tables on SQL Server from a Web Hoster. I have no way of actually coping the tables. So using INSERT SELECT I thought I could just copy the entire table to tableName2 for back up. I tried INSERT Category2 SELECT * FROM Category But it wants the table already defined. I know theres a way to create the table in the statement also. Can anyone help. Thanks, Nick 1 line of code equals many bugs. So don't write any!!