Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 LOCK on Table

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-07-14 : 01:01:33
1.
i have this View:

VIEW_E_D
SELECT Customer,CustomerCode
FROM Employee e JOIN Department d ON e.CustomerCode=d.CustomerCode

and this query:
SELECT ..
FROM Employee e Left Join VIEW_E_D v ON e.CustomerCode=v.CustomerCode

is this query lock Employee Table(because it use the view that have Employee Table)?


2.i have a procedure that run i the job, sometimes the job is stuck becuse this procedure and sometime it is run.
i chaeck the lock with some script ,and i found that spid lock by the same spid, but i dont know why

this procedure:

SELECT ...
INTO #TempT
FROM TABLEA JOIN TABLEB ON ...
JOIN TABLEC ON..
JOIN...

UPDATE TABLEA
SET...

UPDATE TABLEA
SET..
FROM #TempT
WHERE ...

why this procedure stuck?

neeraj1401
Starting Member

36 Posts

Posted - 2009-07-14 : 03:47:06
http://download.microsoft.com/documents/australia/teched2005/hol/HOL076.pdf
Go to Top of Page
   

- Advertisement -