ALTER PROCEDURE [dbo].[t_constru_standar_New]
-- Add the parameters for the stored procedure here
@CodeNum varchar(100),
@TitleContent varchar(100),
@Description varchar(1000),
@StandardType varchar(50),
@StandardType2 varchar(50),
@IsEffective varchar(10),
@KeyWord varchar(500),
@DealItem varchar(50),
@ID int output
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
insert into dbo.t_constru_standard (
[CodeNum],
[TitleContent],
[Description],
[StandardType],
[StandardType2],
[IsEffective],
[KeyWord],
[DealItem],
[Id]
)
values(
@CodeNum,
@TitleContent,
@Description,
@StandardType,
@StandardType2,
@IsEffective,
@KeyWord,
@DealItem,
@ID
)
select @ID=@@identity
declare @i int
set @i=@@ERROR
return @i
END
用 SCOPE_IDENTITY(); 或去掉SET NOCOUNT ON