Welcome to Sign in | Help

Re: o problema de update

  •  07-30-2007, 7:44 PM

    Re: o problema de update

    Incearca:

    DECLARE @tmp TABLE(id tinyint IDENTITY(1, 1), col1 varchar(10))
    INSERT INTO @tmp VALUES('a')
    INSERT INTO @tmp VALUES('b')
    INSERT INTO @tmp VALUES('c')
    INSERT INTO @tmp VALUES('d')............etc......

     UPDATE Table1 SET c3 = NULL, c4 = tmp.col1
    FROM Table1 t1 JOIN @tmp tmp ON t1.id = tmp.id

    *Table1 este tabelul  (id, c1, c2, c3, c4)

     

View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems