Gal Ratner
Gal Ratner is a Techie who lives and works in Los Angeles CA and Austin TX. Follow galratner on Twitter Google
Update a record in a SQL Server table from another record in the same table

In SQL Server you can update record fields with the values from another record using the following TSQL:

UPDATE
        t1
SET
       t1.MyColumn = t2.MyColumn
FROM
      MyTable AS t1, MyTable AS t2
WHERE
     t1.ID = @ID1 AND
     t2.IP = @ID2

This will update your table’s column with a value from another record.
Enjoy!


Posted 22 Aug 2009 4:15 AM by Gal Ratner
Filed under: , ,

Powered by Community Server (Non-Commercial Edition), by Telligent Systems