SQL存储过程 ')' 附近有语法错误。
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';
报错显示在这一行!!! 展开
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';
报错显示在这一行!!! 展开
2个回答
展开全部
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
不需要括号
@NAME nvarchar(200),@TITLE nvarchar(50),@CONTENT nvarchar(50),@FORMATCONTENT nvarchar(50),
@INPUTDATE Datetime,@INPUTSOURCE nvarchar(50),@CATECODE nvarchar(50),@success int output
不需要括号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询