存储过程出了点小问题,路过的大神麻烦看一下
create procedure add_customer_info_tab
(
@param1 int,
@param2 varchar(24),
@param3 varchar(24),
@param4 varchar(24),
@param5 varchar(24),
@param6 varchar(24),
@param7 varchar(24),
@param8 varchar(24),
@param9 varchar(24),
@param10 varchar(24),
@param11 varchar(60),
@param12 varchar(1000),
)
as
delete from customer_info_tab where id=param1;
insert into customer_info_tab
(id,name,area,profession,vocation,company,approach,email,phone,mobile,interest,memo)
values(param1,param2,param3,param4,parma5,param6,param7,param8,param9,param10,param11,param12
消息 102,级别 15,状态 1,过程 add_customer_info_tab,第 15 行
')' 附近有语法错误
看了好半天就是不知道哪出了问题,我是SQL新手,麻烦多多指导
------解决方案--------------------
delete from customer_info_tab where id=@param1;
insert into customer_info_tab
(id,name,area,profession,vocation,company,approach,email,phone,mobile,interest,memo)
values(@param1,@param2,@param3,@param4,@parma5,@param6,@param7,@param8,@param9,@param10,@param11,@param12)
--少了@
------解决方案-------------------- create procedure add_customer_info_tab
(
@param1 int,
@param2 varchar(24),
@param3 varchar(24),
@param4 varchar(24),
@param5 varchar(24),
@param6 varchar(24),
@param7 varchar(24),
@param8 varchar(24),
@param9 varchar(24),
@param10 varchar(24),
@param11 varchar(60),
@param12 varchar(1000) -->这里多了逗号
)
as
set nocount on -->加这行屏闭消息
delete from customer_info_tab where id=param1;
insert into customer_info_tab
(id,name,area,profession,vocation,company,approach,email,phone,mobile,interest,memo)
values(param1,param2,param3,param4,parma5,param6,param7,param8,param9,param10,param11,param12)
go
------解决方案-------------------- 引用: create procedure add_customer_info_tab
(
@param1 int,
@param2 varchar(24),
@param3 varchar(24),
@param4 varchar(24),
@param5 varchar(24),
@param6 varchar(24),
@param7 varchar(24),
@param8 varchar(24),
@param9 varchar(24),
@param10 varchar(24),
@param11 varchar(60),
@param12 varchar(1000),
)
as
delete from customer_info_tab where id=param1;
insert into customer_info_tab
(id,name,area,profession,vocation,company,approach,email,phone,mobile,interest,memo)
values(param1,param2,param3,param4,parma5,param6,param7,param8,param9,param10,param11,param12
消息 102,级别 15,状态 1,过程 add_customer_info_tab,第 15 行
')' 附近有语法错误
看了好半天就是不知道哪出了问题,我是SQL新手,麻烦多多指导
后面insert 语句的values列表里