Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Locking Hints


Locking Hints

Author
Message
MyDoggieJessie
MyDoggieJessie
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5251 Visits: 7368
Comments posted to this topic are about the item Locking Hints

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience" ;-)
Lokesh Vij
Lokesh Vij
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1716 Visits: 1599
Easy and Nice question for the day. Thanks Serge :-)

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


demonfox
demonfox
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1305 Visits: 1192
:-)
Lokesh Vij (2/20/2013)
Easy and Nice question for the day. Thanks Serge :-)


SQL Server assumes that this is a table alias :-D


+1

~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one Ermm
Christian Buettner-167247
Christian Buettner-167247
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3053 Visits: 3889
Nice question, but the explanation lacks important information. Let me quote it for you here:
Table Hints (Transact-SQL) - SQL Server 2008 R2

WITH ( <table_hint> ) [ [ , ]...n ]

With some exceptions, table hints are supported only when the hints are specified with the WITH keyword. Parentheses are required.
Important note
Important

Omitting the WITH keyword is a deprecated feature and will be removed in a future version of Microsoft SQL Server. Always specify WITH in new development work, and modify applications that currently omit this keyword.

Separating hints by spaces instead of commas is a deprecated feature and will be removed in a future version of Microsoft SQL Server. Always specify commas in new development work, and modify applications that currently omit commas.

The following table hints are allowed with and without the WITH keyword: NOLOCK, READUNCOMMITTED, UPDLOCK, REPEATABLEREAD, SERIALIZABLE, READCOMMITTED, FASTFIRSTROW, TABLOCK, TABLOCKX, PAGLOCK, ROWLOCK, NOWAIT, READPAST, XLOCK, and NOEXPAND. When these table hints are specified without the WITH keyword, the hints should be specified alone. For example, FROM t WITH (TABLOCK). When the hint is specified with another option, the hint must be specified with the WITH keyword. For example, FROM t WITH (TABLOCK, INDEX(myindex)).

The restrictions apply when the hints are used in queries against databases with the compatibility level of 90 and higher.

http://msdn.microsoft.com/en-us/library/ms187373%28v=sql.105%29.aspx

If you are working with a different SQL Server version, be sure to read the corresponding documentation version as well.

Best Regards,

Chris Büttner
Dineshbabu
Dineshbabu
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1096 Visits: 569
Nice and easy one. Initially I overlooked the word WTH and answered the question. After seeing the explaination only i realised it was mispelled and it will act as alias name.


Thanks for your brief explaination Chris Büttner ...

--
Dineshbabu
Desire to learn new things..
ldorian81
ldorian81
Old Hand
Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)

Group: General Forum Members
Points: 382 Visits: 314
I see what you did there, nice 1.

Good Question!

Regards
ld

Stoke-on-Trent
United Kingdom

If at first you don't succeed, go to the pub and drink away your current thought plan.
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6291 Visits: 7190
Christian Buettner-167247 (2/21/2013)
Nice question, but the explanation lacks important information. Let me quote it for you here:
Table Hints (Transact-SQL) - SQL Server 2008 R2

WITH ( <table_hint> ) [ [ , ]...n ]

With some exceptions, table hints are supported only when the hints are specified with the WITH keyword. Parentheses are required.
Important note
Important

Omitting the WITH keyword is a deprecated feature and will be removed in a future version of Microsoft SQL Server. Always specify WITH in new development work, and modify applications that currently omit this keyword.

Separating hints by spaces instead of commas is a deprecated feature and will be removed in a future version of Microsoft SQL Server. Always specify commas in new development work, and modify applications that currently omit commas.

The following table hints are allowed with and without the WITH keyword: NOLOCK, READUNCOMMITTED, UPDLOCK, REPEATABLEREAD, SERIALIZABLE, READCOMMITTED, FASTFIRSTROW, TABLOCK, TABLOCKX, PAGLOCK, ROWLOCK, NOWAIT, READPAST, XLOCK, and NOEXPAND. When these table hints are specified without the WITH keyword, the hints should be specified alone. For example, FROM t WITH (TABLOCK). When the hint is specified with another option, the hint must be specified with the WITH keyword. For example, FROM t WITH (TABLOCK, INDEX(myindex)).

The restrictions apply when the hints are used in queries against databases with the compatibility level of 90 and higher.

http://msdn.microsoft.com/en-us/library/ms187373%28v=sql.105%29.aspx

If you are working with a different SQL Server version, be sure to read the corresponding documentation version as well.


+1

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Raghavendra Mudugal
Raghavendra Mudugal
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1756 Visits: 2958
Dineshbabu (2/21/2013)
Nice and easy one. Initially I overlooked the word WTH and answered the question. After seeing the explaination only i realised it was mispelled and it will act as alias name.


Thanks for your brief explaination Chris Büttner ...


+1

seriously... i forgot to wear my glasses and for WTH I actually read as WITH and when my choice was marked as wrong I was really like WTH (i mean the.... expression) and then whole thing came to my understanding...

Really interesting question, thank you for posting... more to see like these... so simple... and yet... i scr.... up

(not sure what is with me... I am getting dumber and dumber each day... as I am supposed to be going the other way.. duh!!! ) ;-)

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
(Bob Brown)
(Bob Brown)
SSC Eights!
SSC Eights! (849 reputation)SSC Eights! (849 reputation)SSC Eights! (849 reputation)SSC Eights! (849 reputation)SSC Eights! (849 reputation)SSC Eights! (849 reputation)SSC Eights! (849 reputation)SSC Eights! (849 reputation)

Group: General Forum Members
Points: 849 Visits: 1145
Thanks for an excellent question today.
ITGuy268
ITGuy268
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 278
Interesting question - luckily I spotted 'WTH' wasn't colour coded as keyword and was mispelt :-)

MCTS | MCITP | Microsoft SQL Server 2008 Administration & Development
MCSA | MCSE | Business Intelligence SQL Server 2012
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search