Everyday brings something new. This is an attempt to blog things learnt on a daily basis to solve issues in our environment from DBAs, colleagues and the great collection of articles in the field. Please share your comments, alternative solutions and suggestions.
update t set [count] = x.cnt from [servername].[dbname].[dbo].[table1] t, (Select tk,count(ID) as cnt from [servername].[dbname].dbo.table2 with (nolock) group by tk) x where x.tk=t.tk
No comments:
Post a Comment