September 13, 2005 at 7:18 am
I am trying to use the nolock option for an sql statement. but i get the error as
Incorrect syntax near the keyword 'with'
the statement i am using is
select * from inner join dbo.cataddon_reportquery on cataddon_reportquery.userid = .loginname with (nolock)
if i am not using the inner join then its working well. is there any work around for this.
I mean i don't want locks to be created on any tables in the statement.
September 13, 2005 at 7:19 am
select * from with (nolock) inner join dbo.cataddon_reportquery with (nolock) on cataddon_reportquery.userid = .loginname
September 13, 2005 at 7:27 am
Preface the entire SELECT with: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED and forget the individual table settings.
September 13, 2005 at 7:37 am
Thanks very much Lee Dise, But setting
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
how does this have effect on other queries.
does this stand good for the immediate query or on all further queries.
September 13, 2005 at 7:39 am
Turn it off when you want it off with: SET TRANSACTION ISOLATION LEVEL READ COMMITTED
Its effect stays on until you tell it otherwise.
If you want to lock only individual tables, you need to revert to the other method.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply