April 8, 2008 at 2:40 pm
Hi,
I have a question whether can I use NOLOCK hint in SELECT clause of the INSERT statement like this one ?
INSERT INTO table3 (
AttributeID,
IssuerID
)
SELECT distinct
fm.AttributeID,
asp.SecurityID AS IssuerID,
FROM table1 a WITH (NOLOCK) - IS this ok ?
INNER JOIN table2 asp WITH (NOLOCK) - IS this ok ?
ON a.PolicyID = asp.PolicyID
Also, how about select into statement ? ???
Thank you,
V
April 8, 2008 at 3:02 pm
yes, both of those statements are just fine. Be aware of the consequences you could face by using nolock (dirty reads, etc.)
April 8, 2008 at 3:06 pm
Yes, you can use it but downside is that, because the statement does not issue any locks against the tables being read, some "dirty," uncommitted data could potentially be read.
[font="Verdana"]--www.sqlvillage.com[/size][/font]
April 8, 2008 at 4:38 pm
Makes sense..
Thank you,
V
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply