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 |
Swati Jain
Posting Yak Master
139 Posts |
Posted - 2007-09-14 : 02:20:28
|
Hello All, In a table there are 2 columns named column1 and column2by mistake , values of column1 was entered in column2 and vise versa what query to execute, to exchnage values of columnc in table? |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-14 : 03:13:54
|
DECLARE @Temp INTUPDATE Table1SET @Temp = Col1, Col1 = Col2, Col2 = @Temp E 12°55'05.25"N 56°04'39.16" |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-14 : 03:33:02
|
[code]declare @a table (i int, j int)insert @a select 1, 4select 'before', * from @aUPDATE @aSET i = j, j = iselect 'after', * from @a[/code] E 12°55'05.25"N 56°04'39.16" |
|
|
|
|
|