Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Same stored procs and different schemas = issues? Expand / Collapse
Posted Wednesday, March 20, 2013 9:40 PM


Group: General Forum Members
Last Login: Yesterday @ 6:02 PM
Points: 155, Visits: 457
I have two stored procs which are identical, except they exist in 2 different schemas. Stored proc A in schema dbo references objects, views, tables in the dbo schema. (all of which are named properly using the schema preface). Stored proc B in schema ABC references objects, views, tables in the dbo schema (since it's the same as the other one). The only difference between these two schemas is their name, since of course, they exist in 2 schemas. (This was done soley for organizational purposes, and the original A dbo sproc was going to go away.)

So. Here's where it gets odd.

I expected them both to run/perform the same way. However, both were set up to run as a step in a job in the SQL Agent. Stored proc A, which is in the dbo schema runs perfectly fine. Stored proc B does not consistently perform fine. It has issues. Runs forever, won't finish, ends up locking things up.

I'm confused in why code running from two different schemas operates differently, despite the proper naming conventions between them both. As a fix, i had to comment out the step that references schema B and just let the step with the schema A stored proc run.

Are there any ideas out there of what may be going on or what I might check out? (And if I've left out any details that would help research this, do let me know.)

Any help would be appreciated.
Post #1433572
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse