There are various methods on net to swap values of two column, tried many of them. This one seems to be working for me: UPDATE table_name SET A=B, B=@temp WHERE (@temp:=A) ; Some of the queries that don't work are: 1. DECLARE @temp AS varchar(10) UPDATE Employee1 SET @temp=LastName, LastName=FirstName, FirstName=@temp 2. UPDATE Employee1 SET LastName=FirstName, FirstName=LastName NOTE: talking about sql query only, not including SAS etc
The blog will contain all the Technical knowledge I have to share and I welcome & would appreciate others for sharing their knowledge :0)