November 29, 2012 at 2:18 pm
Hello All
question for you all if possible to answer. Is it possible to run an exec command with No lock applied to it.
exec database.dbo.storeprocedure WITH (NOLOCK)
or do you have to manuipulate the SP
if there is not maybe it's time to call MS and give them a job lol
,
thanks twahl0630
November 29, 2012 at 2:24 pm
Did you highlight it and try to run it? That's the best way to find out...
Jared
CE - Microsoft
November 29, 2012 at 2:28 pm
No, you need to place the query hint inside the stored-procedure itself, however you could set the TRANSACTION ISOLATION LEVEL to READ UNCOMMITTED and that will set it for the scope of your session.
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience
January 3, 2013 at 1:54 pm
That will work as long you don't care about missing/duplicate data or a host of other nearly impossible bugs to figure out. I would highly recommend you get very familiar with what you are implying with NOLOCK and READ UNCOMITTED.
http://blogs.msdn.com/b/davidlean/archive/2009/04/06/sql-server-nolock-hint-other-poor-ideas.aspx
http://www.jasonstrate.com/2012/06/the-side-effect-of-nolock/[/url]
It is frequently better to use a different isolation level (snapshot possibly) to avoid locks when retrieving data. Read up on isolation and research what is best for your situation.
http://msdn.microsoft.com/en-us/library/ms173763.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply