日期:2014-05-18  浏览次数:20510 次

请教各位帮忙检查一个存储过程!
存储过程执行没有报错,但就是Ass.c1_List插不进去数据,请大家指点下,谢谢了
ALTER   PROCEDURE   "aa ". "InsertTest "(@CName   varchar(50),@CLxr   varchar(50)=
null,@CTel   varchar(50)=
null,@CSoft   varchar(50)=
null,@CBz   varchar(50)=
null)
as
declare   @id   int  
insert   into   Ass.c(   CustomerName,CLxr,CPhone,Csoft,CBz)   values(   @CName,@CLxr,@CTel,@CSoft,@CBz)
select   @CName,@CLxr,@CTel,@CSoft,@CBz
select   @id=@@IDENTITY
insert   into   Ass.c1_List(   ID1,CBz)   values(   @id,@CBz)
select   @id,@CBz


------解决方案--------------------
http://community.csdn.net/Expert/topic/5443/5443615.xml?temp=.4814112
------解决方案--------------------
试一下:
ALTER PROCEDURE "aa ". "InsertTest "(@CName varchar(50),@CLxr varchar(50)=
null,@CTel varchar(50)=
null,@CSoft varchar(50)=
null,@CBz varchar(50)=
null)
as
declare @id int
insert into Ass.c( CustomerName,CLxr,CPhone,Csoft,CBz) values( @CName,@CLxr,@CTel,@CSoft,@CBz)
select @CName,@CLxr,@CTel,@CSoft,@CBz
select @id=SCOPE_IDENTITY()
insert into Ass.c1_List( ID1,CBz) values( @id,@CBz)
select @id,@CBz