usemastergoalterprocInsertData(@NAMEnvarchar(200),@TITLEnvarchar(50),@CONTENTnvarchar...
use mastergo
alter proc InsertData(@NAME nvarchar(200),@TITLE nvarchar(50),@CONTENT nvarchar(50),@FORMATCONTENT nvarchar(50),@INPUTDATE Datetime,@INPUTSOURCE nvarchar(50),@CATECODE nvarchar(50),@success int output)asbegin begin tran --开始执行事务 declare @errorNum int set @errorNum=0 declare @KEYID bigint declare @KNOWID bigint declare @WORDID bigint declare @KNOWCATE bigint insert into KEYWORDSDATA([NAME]) values (@NAME) set @KEYID=@@IDENTITY set @errorNum =@errorNum+ @@error insert into KNOWLEDGE(TITLE,[CONTENT],FORMATCONTENT,INPUTDATE,INPUTSOURCE) values(@TITLE,@CONTENT,@FORMATCONTENT,@INPUTDATE,@INPUTSOURCE) set @KNOWID=@@identity set @errorNum =@errorNum+@@error
insert into KEYWORDS(KNOELEDGEID ,KEYWORDSCODE) values(@KNOWID,@KEYID) set @WORDID=@@identity set @errorNum =@errorNum+@@error insert into KNOWLEDGECATE(KNOWLEDGEID,CATECODE) values(@KNOWID,@CATECODE) set @KNOWCATE=@@identity set @errorNum =@errorNum +@@error if @@error<>0 --判断如果两条语句有任何一条出现错误begin set @success=0 rollback tran endelse --如何两条都执行成功begin set @success=1 commit tran endendgo
exec InsertData 'sdf','sefe' ,'frv' ,'adfe' ,getdate(),'saefa' ,'aea' ,'1';select * from KEYWORDSDATAselect * from KNOWLEDGEselect * from KEYWORDS
exec InsertData 'sdf','sefe' ,'frv' ,'adfe' ,getdate(),'saefa' ,'aea' ,'1';
报错显示在这一行!!!