I'm attempting to place data in one of my existing table into another existing table.
Can you really place data into any existing table using
select * into query.
I believe it is possible using union but for the reason that situation i have to record all data of my existing table into temporary table, then drop that table and lastly than apply union to place all records into same table
select * into #tblExisting from tblExisting drop table tblExisting select * into tblExisting from #tblExisting union tblActualData
Here tblExisting may be the table where I really wish to store all data tblActualData may be the table where data will be appended to tblExisting.
Could it be right method. Do we've got some other alternative ?
You should attempt
INSERT INTO ExistingTable (Columns,..) SELECT Columns,... FROM OtherTable
Take a look at INSERT
No, you can't use
SELECT INTO to place data into a current table.
The documentation makes this very obvious:
SELECT…INTO produces a new table within the default filegroup and card inserts the resulting rows in the query in it.
You generally wish to stay away from
SELECT INTO being produced because it offers a superior hardly any treatments for the way the table is produced, and can result in a variety of nasty securing along with other performance problems. You need to create schemas clearly and employ
INSERT - for temporary tables.
Update from CTE? http://www.sqlservercentral.com/Forums/Topic629743-338-1.aspx