UPDATE table1
SET ID,[DESC] =
( SELECT ID,[DESC]
FROM tmptable
WHERE tmptable.ID_SUN = table1.ID_SUN)
WHERE EXISTS
( SELECT ID,[DESC]
FROM tmptable
WHERE tmptable.ID_SUN = [Table1].ID_SUN)
I tired this but i coudn't uptade tow columns at once
do i need to seperate them or i have any mistake?

Yes, you need to separate them. The syntax should be more like

UPDATE SomeTable
SET   Column1 = SomeValue1,
        Column2 = SomeValue2,
        Column3  = ....

It doesn't look like you need a subquery either. A simple join should be sufficient. Something like

UPDATE t1
SET    t1.ID = tmp.ID,
         t1.[DESC] = tmp.[DESC]
FROM   
        tmptable tmp INNER JOIN table1 t1
        ON tmp.ID_SUN = t1.ID_SUN
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.