| Author: Anjali Sharma 30 Jun 2008 | Member Level: Gold Points : 0 |
hi ur code is not wrking
|
| Author: Bunty 30 Jun 2008 | Member Level: Diamond Points : 1 |
Hi Angali,
May i know the error what u r getting.
|
| Author: Payal Jain 01 Jul 2008 | Member Level: Gold Points : 1 |
try using the columns names too like
Insert into new_table(column1,column2) Select column1,column2 from existing_table
|
| Author: Abhijeet Kumar 03 Jul 2008 | Member Level: Gold Points : 1 |
Try something like:
INSERT INTO Names_New (name, state) SELECT name, state FROM Names_Old
|
| Author: UltimateRengan 04 Jul 2008 | Member Level: Diamond Points : 2 |
hi, Your Code is not working. This is the correct format for insert values from existing table into new table with same table structure select * into NewTableName from ExistingTableName EX: select * into GG from b
i hope this may help u
|
| Author: UltimateRengan 04 Jul 2008 | Member Level: Diamond Points : 2 |
this error will occur:
Msg 208, Level 16, State 1, Line 1 Invalid object name 'c'.
|
| Author: UltimateRengan 04 Jul 2008 | Member Level: Diamond Points : 2 |
hi,
|
| Author: Bunty 04 Jul 2008 | Member Level: Diamond Points : 2 |
Hi UltimateRengan,
first understand question clearly then reply.I know u r very smart.
I try my code is working.
There is one table already exist say table1 with the same structure say table2.
Whatever answer u r posted is also right but it will create the table and i m talking about if table is already exist.
|
| Author: Bunty 04 Jul 2008 | Member Level: Diamond Points : 2 |
Hi UltimateRengan,
first understand question clearly then reply.I know u r very smart.
I try my code is working.
There is one table already exist say table1 with the same structure say table2.
Whatever answer u r posted is also right but it will create the table and i m talking about if table is already exist.
|
| Author: Bunty 04 Jul 2008 | Member Level: Diamond Points : 2 |
Hi UltimateRengan,
You follow the steps that i m mentioning below.
Select * into table1 from table2 where 1=2 It will create the table1 with the same structure as that of table2.
Now try my code given below.
Insert into table1 Select * from table2
Now tell whether it will give error or not..
|
| Author: Pravin 07 Jul 2008 | Member Level: Silver Points : 0 |
Select * into New_Table FROM Old_Table
|
| Author: Jaya Kumar 10 Jul 2008 | Member Level: Gold Points : 0 |
SELECT * FROM Table1 INTO Table2
|
| Author: palla 28 Aug 2008 | Member Level: Silver Points : 2 |
hi for using this insert first we have to create the table.it wont copies the same structure as source table.
insert into destinationtable(already existed table)(columlist) select * or (columlist) from source table where
try it .it can work for permananttables,temporarytablesand for table variables also.
|