It would be great if you explain the logic of this statement There are many techniques to avoid correlated sub query such in your post 1.MERGE Command already mentioned 2.Using common table expression 3.Using update from technique which I would not recommend And sure, you need to have properly defined indexes to speed up the query.. Do you have ones on the columns use in Join?
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
No comments:
Post a Comment