Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 18th, 2006, 08:39 AM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with the views execution when run as a job

hi,

I have peculiar but interesting problem.

I have a DTS Package which is transforming data from a view to a table.

The view that is used in the source is nested up to six levels.
It is similar to the below.

Assuming the 6 views as v1 , v1 ...v6

---View 1 definition ------

select a , b , ...... from tbl a inner join v2 on....

----View 2 definition-----

select a,b,...... from tbl a inner join v3 on ...

---view 3 definition---

select v3.a , v3.b ..... v3.1 from v4 inner join v5 on
a.v3 = a.v4 and a.v3 = a.v5 and a,v3 = a.v6 on
a.v4 = a.v5 and a.v4 = a.v6
...
...

... and the join is until for v6 and atleast 3 columns for eash view.

Views v4 , v5 , v6 are selecting atleast 6 coulmns from different tables and also from table a used in v1 and v2.


The DTS package is scheduled as job.There are other steps too in the package and this DTS runs at the third step.The job runs successfully some times but hangs at the third step at times and there is no clue why it hangs.
But when the job is cancelled and rerun after hanging , it runns successfully the second time and there are no issues the
second time.

A trace was run and there is no information of dead locks and time outs on the trace , there is no information on the errorlog for dead locks.

But i presume the issue is with locks but have no proof for the same.

At the time when the job hangs there are number of context ids for the spid that runs the job.

When i queried for locks , i found all the locks for the above mentioned tables and views are Sch - S locks and with GRANT status execpt for one lock which was Sch - M with a WAIT status

But I am not sure why there is Sch - M when there is no change in the schema and the views are just doing a select.

And the peculiar thing is job is running successfully when it is run the secon time.

As i am using only views I am not able to insert into any table to audit the process and check the place of issue.

Please provide any inputs on how to identify the issue.

Regards
Venkat








Similar Threads
Thread Thread Starter Forum Replies Last Post
Package runs, Job doesn't run polofson SQL Server DTS 0 July 28th, 2006 10:41 AM
Job fails & need to use domain\user acct to run kiwikencox SQL Server 2000 1 October 17th, 2005 09:30 PM
Error when code run as a job bjrichard SQL Server DTS 8 March 17th, 2005 12:20 AM
converting Access 2000 views to Sql views matta Classic ASP Professional 1 January 26th, 2005 03:37 PM
Run-time code execution module0000 Beginning VB 6 1 June 20th, 2003 04:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.