Monday, December 5, 2011

swap tabls column

declare @temp as int
update swap set @temp=newid,newid=id,id=@temp


int--datatype must be same for both columns

swap-table name
newid,id -column name

1 comment:

  1. string a = "sandeep";
    string b = "vivek";
    string c = b;
    b = a;
    a = c;
    Response.Write(a + "" + b);

    ReplyDelete