When I run the sql statement shown below,and then look at the current activity - locks/process id in enterprise manager, I find that the statement blocks itself.
INSERT INTO TempRptisaacson (YB_MKTCode, YB_ADCode, YB_STCode, YB_MediaType, YB_ADName, YB_AGCode, YB_AGName, YB_INCode, YB_INSubCode)
SELECT REV_MktCode, REV_ADCode, REV_STCode, REVMediaType, Min(ADName), REV_AGCode, Min(AGName), Min(AD_INCode), Min(AD_INSubCode)
FROM Revenue WITH (NOLOCK) INNER JOIN Advertisers WITH (NOLOCK) on REV_ADCode = ADCode INNER JOIN Agencies WITH (NOLOCK) on REV_AGCode = AGCode
WHERE REV_MktCode = 169 AND AD_INCODE <> 40 AND REV_Period BETWEEN '2005/01' AND '2006/07'
GROUP BY REV_MktCode, REV_ADCode, REV_STCode, REVMediaType, REV_AGCode
ORDER BY REV_ADCode, REV_STCode, REV_AGCode
Is this normal? Is there something I can do to prevent it from blocking? This does cause a problem when two or more people are running the job at the same time.
The revenue table has over 17 million rows of data.
The advertiser table has a little over a million rows.
The agency table has about 235,000 rows.
Enterprise manager current activity shows Process ID 54 5 times with context ids from 0 to 4. Context ID 4 shows it is blocked by Process ID 54, and is sleeping. Context id 3 shows it is "runnable". Context id's 0,1,and 2 are also sleeping.
Under Locks/Process ID, spid 54 shows (Blocked by 54)
Then it shows spid 54 as (Blocking).
I am running under Microsoft SQL Server 2000 8:00.2039
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
INSERT INTO TempRptisaacson (YB_MKTCode, YB_ADCode, YB_STCode, YB_MediaType, YB_ADName, YB_AGCode, YB_AGName, YB_INCode, YB_INSubCode)
SELECT REV_MktCode, REV_ADCode, REV_STCode, REVMediaType, Min(ADName), REV_AGCode, Min(AGName), Min(AD_INCode), Min(AD_INSubCode)
FROM Revenue WITH (NOLOCK) INNER JOIN Advertisers WITH (NOLOCK) on REV_ADCode = ADCode INNER JOIN Agencies WITH (NOLOCK) on REV_AGCode = AGCode
WHERE REV_MktCode = 169 AND AD_INCODE <> 40 AND REV_Period BETWEEN '2005/01' AND '2006/07'
GROUP BY REV_MktCode, REV_ADCode, REV_STCode, REVMediaType, REV_AGCode
ORDER BY REV_ADCode, REV_STCode, REV_AGCode
Is this normal? Is there something I can do to prevent it from blocking? This does cause a problem when two or more people are running the job at the same time.
The revenue table has over 17 million rows of data.
The advertiser table has a little over a million rows.
The agency table has about 235,000 rows.
Enterprise manager current activity shows Process ID 54 5 times with context ids from 0 to 4. Context ID 4 shows it is blocked by Process ID 54, and is sleeping. Context id 3 shows it is "runnable". Context id's 0,1,and 2 are also sleeping.
Under Locks/Process ID, spid 54 shows (Blocked by 54)
Then it shows spid 54 as (Blocking).
I am running under Microsoft SQL Server 2000 8:00.2039
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)