Stored procedure calls multiple stored procedures

Stored procedure calls multiple stored procedures

Post by EverGim » Wed, 25 Feb 2004 01:38:26



I've got some maintenance stored procedures I wanted to group into a single
stored procedure and run.  Everything runs great individually.

However, whenever I try put all the stored procedures into a single stored
procedure I'm finding some of them aren't inserting all the records.  When I
pull that single line call out and run it form the query analyzer everything
runs correctly.

i.e.
EXEC dbo.sp_LICXPRODINSERT 'contact2.uedistat', 'EDIXMIT',
'contact2.uediformt'
EXEC dbo.sp_LICXPRODDELETEFROMGM 'contact2.uedistat', 'EDIXMIT',
'contact2.uediformt'
EXEC dbo.sp_LICXPRODUPDATEFROMGM 'contact2.uedistat', 'EDIXMIT',
'contact2.uediformt'

EXEC dbo.sp_LICXPRODINSERT 'contact2.uacctstat', 'ACCOUNTING', '''0'''
EXEC dbo.sp_LICXPRODDELETEFROMGM 'contact2.uacctstat', 'ACCOUNTING', '''0'''
EXEC dbo.sp_LICXPRODUPDATEFROMGM 'contact2.uacctstat', 'ACCOUNTING', '''0'''

When this is run from an individual stored procedure, the licxprodinsert for
'ACCOUNTING' fails to add all the records.  but when run individually from
Query Analyzer it works fine, so the licxprodinsert stored procedure seems
to be working correctly.  I dont' know if I need to switch cursors or what.

Thanks in advance.

 
 
 

Stored procedure calls multiple stored procedures

Post by oj » Wed, 25 Feb 2004 02:56:37


If you post the ddl+sample data+sproc code, maybe someone can have a closer
look. It's hard for us to know what's going without some repro script.

--
-oj
http://www.rac4sql.net


Quote:> I've got some maintenance stored procedures I wanted to group into a
single
> stored procedure and run.  Everything runs great individually.

> However, whenever I try put all the stored procedures into a single stored
> procedure I'm finding some of them aren't inserting all the records.  When
I
> pull that single line call out and run it form the query analyzer
everything
> runs correctly.

> i.e.
> EXEC dbo.sp_LICXPRODINSERT 'contact2.uedistat', 'EDIXMIT',
> 'contact2.uediformt'
> EXEC dbo.sp_LICXPRODDELETEFROMGM 'contact2.uedistat', 'EDIXMIT',
> 'contact2.uediformt'
> EXEC dbo.sp_LICXPRODUPDATEFROMGM 'contact2.uedistat', 'EDIXMIT',
> 'contact2.uediformt'

> EXEC dbo.sp_LICXPRODINSERT 'contact2.uacctstat', 'ACCOUNTING', '''0'''
> EXEC dbo.sp_LICXPRODDELETEFROMGM 'contact2.uacctstat', 'ACCOUNTING',
'''0'''
> EXEC dbo.sp_LICXPRODUPDATEFROMGM 'contact2.uacctstat', 'ACCOUNTING',
'''0'''

> When this is run from an individual stored procedure, the licxprodinsert
for
> 'ACCOUNTING' fails to add all the records.  but when run individually from
> Query Analyzer it works fine, so the licxprodinsert stored procedure seems
> to be working correctly.  I dont' know if I need to switch cursors or
what.

> Thanks in advance.