无法在另一个存储过程中调用存储过程

时间:2011-05-21 01:52:05

标签: sql sql-server stored-procedures

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

SD_Sproc_ToGRS_Insurance是我要调用的存储空间。我有一个问题就是调用这个。有谁建议?我正在做一个调用存储过程的正确途径?

1 个答案:

答案 0 :(得分:5)

以上是SQL Server语法。像这样使用exec命令来调用存储过程。

exec storedProcName @param1Name, @param2Name