im useless
im useless

Reputation: 7461

Failed to call a stored procedure within another stored procedure

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[SD_Sproc_Insurance_Insert] 
    -- Add the parameters for the stored procedure here
(
    @HCSInsuranceID bigint,
    @HCSInsuranceCode varchar(10),
    @HCSInsuranceName varchar(100),
    @IsPPS bit,
    @IsActive bit
)
AS
BEGIN TRAN InsuranceInsert
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    INSERT INTO SD_Sproc_ToGRS_Insurance(HCSInsuranceID ,HCSInsuranceCode, HCSInsuranceName, IsPPS ,IsActive)
            VALUES (@HCSInsuranceID ,@HCSInsuranceCode, @HCSInsuranceName, @IsPPS, @IsActive);

COMMIT TRAN InsuranceInsert

The SD_Sproc_ToGRS_Insurance is the stored that I'll call.. I'm having a problem to call this one. Anyone suggest? That I'm doing the right path to call a stored procedure?

Upvotes: 0

Views: 160

Answers (1)

Tahbaza
Tahbaza

Reputation: 9546

The above is SQL Server syntax. Use the exec command like so to call a stored procedure.

exec storedProcName @param1Name, @param2Name

Upvotes: 3

Related Questions