Suppose we have a table named USER with 3 columns: USERID, USERName, USERAddress.
Swap with the temporary variable:
-----------------------------------------------
Hope freshers will find it helpful :)
USERID: int
USERName: varchar(100)
USERAddress: varchar(100)
Swap with the temporary variable:
-----------------------------------------------
DECLARE @temp AS varchar(10) UPDATE USER SET @temp=USERAddress, USERAddress=USERName, USERName=@temp
Hope freshers will find it helpful :)
No comments:
Post a Comment