Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to SQL Server Request SQLWays

Update with Nolock at the From clause

Using table hints without keywird WITH is deprecated in future versions.

Microsoft SQL Server 2000

UPDATE <table_name> SET. FROM <table_name> AS <alias_name>(NOLOCK)

Microsoft SQL Server 2008

UPDATE <table_name> SET. FROM <table_name> AS <alias_name>

Example:

Microsoft SQL Server 2000:

UPDATE tab1 
SET tab1.col1 = 'aaa' 
FROM tab1 AS SWT_Al (NOLOCK) 
WHERE SWT_Al.col2 = 'bbb' 

Microsoft SQL Server 2008:

UPDATE tab1 
SET tab1.col1 = 'aaa' 
FROM tab1 AS SWT_Al 
WHERE SWT_Al.col2 = 'bbb'

Ispirer Home Page Ispirer SQLWays Product Page - Migration to SQL Server Request SQLWays

sqlways/sql-server/upgrade/statementssyntax/updatewithnolock.txt · Last modified: May 07, 2018, 03:15:34 PM (external edit)
 
© 1999-2019, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement