[ACCEPTED]-There is already an object named 'tbltable1' in the database-select-into

Accepted answer
Score: 16

The SELECT INTO statement creates a new table of the 8 name you provide and populates it with the 7 results of the SELECT statement.

I think 6 you should be using INSERT INTO since the table already 5 exists. If your purpose is in fact to populate 4 a temporary table, then you should provide 3 a table name that does not already exist 2 in the database.

See MSDN for more information 1 on this.

Score: 2

If you are confident that tbltable1 is not required, you 7 can drop the table first.

You may also want 6 to consider using temporary tables...

Select * into ##MyTemporaryTable FROM tblTable1_Link 

You 5 can then use the temporary table in this 4 session. (Ending the session should drop 3 the temporary table automatically, if I 2 remember correctly. It's been a while since 1 I've worked with SQL Server).

More Related questions