Wednesday, May 13, 2015

How to update rows randomly

update dbo.Table 
set Field = Value 
where Id in ( select top 50 percent id from dbo.Table order by NEWID() )

No comments:

Post a Comment