CREATE TABLE tab_update (id TINYINT,n1 NVARCHAR(30),v1 NVARCHAR(30),s1 NVARCHAR(30))
INSERT INTO tab_update (id,n1,v1,s1)
SELECT 1,'天','土豆','章子怡'
UNION ALL
SELECT 2,'集團','黃瓜','汪峰'
UNION ALL
SELECT 3,'宇宙','茄子','傑克雋逸'
UNION ALL
SELECT 4,'海洋','西紅柿','劉德華'
UNION ALL
SELECT 5,'大學','蓮藕','鳳凰傳奇'
SELECT * FROM tab_update
DECLARE @var NVARCHAR(30)
UPDATE tab_update
SET
@var=n1, --傳遞值交換
n1 = v1,
v1 = s1,
s1 = @var
SELECT * FROM tab_update
DROP TABLE tab_update