希望大家帮我解决一下sql问题
create procedure staff_proc
(
@staffNumber char(20),
@staffName char(20),
@staffSalary money,
@staffTime int,
@departmentNumber char(20),
@departmentName char(20)
)
as
insert into staff values(@staffNumber,@staffName,@staffSalary,@staffTime,@departmentNumber,@departmentName)
update department
set departmentCount=departmentCount+1
where departmentNumber=@departmentNumber
exec staff_proc '1121811','张三',3000,25,'101','人事部'
将 varchar 值 '人事部 ' 转换为数据类型为 int 的列时发生语法错误。
不知道怎么错了
------解决方案--------------------insert into staff(列名补充对应)
values(@staffNumber,@staffName,@staffSalary,@staffTime,@departmentNumber,@departmentName)
------解决方案--------------------staff表的数据类型错误
insert into staff
(列名对应)
values(@staffNumber,@staffName,@staffSalary,@staffTime,@departmentNumber,@departmentName)