Hi Guys, I've tried two different approaches to creating a backup table. The end result I want is an exact duplicate the sample name below "existing_table."
Using SQL 2005 btw with 2008 management studio.
When I try:
CREATE TABLE [dbName].[dbo].[backup] AS SELECT * FROM [dbName].[dbo].[existing_table]
I get a syntax error saying this: Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'AS'.
Then I tried this:
SELECT * INTO [TMCCommon].[dbo].[backup] FROM [TMCCommon].[dbo].[existing_table]
It said that all of the rows were affected, but the new table I want created "backup" is nowhere to be found! And it says when I try to run the query again that the "backup" object already exists.
Management Studio has a bit of quirk where it won't show a new object until you refresh. Go to the tables in the left nav then right click and choose refresh. Your table should now appear.