October 26, 2009 at 10:32 am
I need to query information from an oracle database frequently, and I am collecting this data in a sql server database for analysis.
Since I constantly query using openquery, I made some permanent temp tables for this purpose, with a key defined inside the stored procedure that does the population.
My question, is does the table get locked when performing a query like:
declare @GUID uniqueidentifier
select @GUID = newid()
insert into my_temp ([guid], [value_1], [value_2])
select @GUID, * from openquery(linked_server, '
select a,b from oracle_table
where condition = ''test''
')
Regards
Martin
October 26, 2009 at 12:17 pm
Sure, there will be locks on the table being inserted into while the insert happens. Depending on the indexes and some other factors the type of lock will vary from row to page to table. The database has to take some kind of locks to keep you from getting dirty and phantom reads and conflicting updates/inserts.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply