Juan Velasquez
asked on
Stored procedure is skipping a nested stored procedure
Hello,
When I call the attached stored procedure, EXEC sp_SupportTeamDataInsert is not being executed. I have performed the following test with these results
In all cases EXEC sp_DistributionTableInsert executes. However, it looks like EXEC sp_SupportTeamDataInsert is not executed. When I execute just EXEC sp_SupportTeamDataInsert, that sproc works fine. This is in a MS SQL Server 2005 environment
When I call the attached stored procedure, EXEC sp_SupportTeamDataInsert is not being executed. I have performed the following test with these results
In all cases EXEC sp_DistributionTableInsert
ALTER PROCEDURE [dbo].[sp_PopulateDistributionTable]
AS
TRUNCATE TABLE Distribution
BEGIN TRAN
BEGIN TRY
EXEC sp_DistributionTableInsert
EXEC sp_SupportTeamDataInsert
DELETE FROM Distribution Where LastPostedDate < POPStart
DELETE D FROM Distribution D
INNER JOIN TaskOrderContributions TOC
ON D.TaskOrder = TOC.TaskOrder
WHERE TOC.Eligible = 0
COMMIT TRAN
END TRY
BEGIN CATCH
RAISERROR('Transaction Aborted', 16, 1)
ROLLBACK TRANSACTION
END CATCH
ALTER PROCEDURE [dbo].[sp_SupportTeamDataInsert]
AS
DECLARE curTaskOrder CURSOR FORWARD_ONLY
FOR SELECT DISTINCT TaskOrder from vwCSIB_ShareAllocationEligibleEmployees
DECLARE @TaskOrder NVARCHAR(50)
OPEN curTaskOrder
FETCH NEXT FROM curTaskOrder INTO @TaskOrder
WHILE @@Fetch_Status = 0
BEGIN
EXEC spDistributionTableSupportTeamInsert @TaskOrder
FETCH NEXT FROM curTaskOrder INTO @TaskOrder
END
CLOSE curTaskOrder
DEALLOCATE curTaskOrder
GO
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please explain the problem clearly.
ASKER