触发器:
ALTER PROCEDURE ControllerTooEnterprise --插入实际控制人的同时更新企业从业人员总数和企业规模@EnterpriseID INT,@Enterprise_People INT,@TrainAll INT,@Enterprise_Scale DECIMAL(9),@ControllerName VARCHAR(50),@ControllerTel VARCHAR(50)
ASBEGINDECLARE @SQL1 VARCHAR(100);DECLARE @SQL2 VARCHAR(100);SET @SQL1='INSERT INTO Controller (ControllerName,ControllerTel,TrainAll,EnterpriseID) VALUES ('''+@ControllerName+''','''+@ControllerTel+''','''+@TrainAll+''','''+@EnterpriseID+''')'SET @SQL2='UPDATE Controller SET (Enterprise_People='+@Enterprise_People+',Enterprise_Scale='+@Enterprise_Scale+') WHERE EnterpriseID='+@EnterpriseIDEXECUTE(@SQL1);EXECUTE(@SQL2);END
执行:
EXECUTE ControllerTooEnterprise 1503,888,888.88,0,'LEE JUN','13998989966'
消息:
将 varchar 值 'INSERT INTO Controller (ControllerName,ControllerTel,TrainAll,EnterpriseID) VALUES ('LEE JUN','15398959966','' 转换为数据类型为 int 的列时发生语法错误。
这到底是个什么情况呢? 头疼
1 回答
- 1 回答
- 0 关注
- 515 浏览
添加回答
举报
0/150
提交
取消