Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
venki8805
Starting Member
3 Posts |
Posted - 2009-06-29 : 16:16:04
|
Hi ,I am having a doubt on queries,plz tell me the solution for the below query.write a single query To delete a column from table1 and add the same deleted column of table1 to table2 and has to display the added column in the table2. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-29 : 16:20:03
|
ALTER TABLE Table2 ADD COLUMN ColX INTGOUPDATE t2SET t2.ColX = t1.ColXFROM Table2 AS t2INNER JOIN Table1 AS t1 ON t1.pkCol = t2.pkColGOALTER TABLE Table1DROP COLUMN ColXGO N 56°04'39.26"E 12°55'05.63" |
 |
|
venki8805
Starting Member
3 Posts |
Posted - 2009-06-30 : 09:43:38
|
Its working fine.thanks for posting answer to my query |
 |
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2009-06-30 : 10:15:11
|
Also have a look at the new output deleted clause of SQL 2005DELETE FROM table1OUTPUT DELETED.* INTO table2 |
 |
|
|
|
|