各位朋友,下面是小弟在查询分析器里面调用存储过程的语句,但出现了“对于局部变量,text、ntext 和 image 数据类型无效”,请问错误在哪里,请各位朋友赐教,谢谢!!!
declare @emp_id nvarchar(50),@card_id nvarchar(20),@no_sign bit,@emp_name nvarchar(50), @id_card nvarchar(50),@position_id nvarchar(50),@sex bit, @job_id nvarchar(50),@hire_date nvarchar(20), @rule_id nvarchar(20), @depart_id nvarchar(20),@status_id nvarchar(20), @photo image, @polity_id nvarchar(20), @native_id nvarchar(20),@nation_id nvarchar(20), @edu_id nvarchar(20), @dorm_id nvarchar(20), @birth_date nvarchar(20),@marriage bit, @gd_date nvarchar(20), @phone_code nvarchar(20), @post_code nvarchar(20), @email nvarchar(50), @address nvarchar(200), @gd_school nvarchar(50), @speciality nvarchar(50),@insert_update nvarchar(10),@message varchar(100)
select @insert_update= 'insert ',@emp_id= '08050009 ',@card_id= '123456789 ',@no_sign= '11 ',
@emp_name= 'ttest ',@id_card= '441282810110008 ',@position_id= '1001 ',
@sex= '0 ',@job_id= '001 ',@hire_date= '2008-8-1 ',@rule_id= '01 ',@depart_id= '001-1-0 ',
@status_id= '001 ',@photo=null,@polity_id= '001 ',@native_id= '001 ',@nation_id= '001 ',
@edu_id= '001 ',@dorm_id= '001 ',@birth_date= '1980-9-1 ',@marriage= '1 ',
@gd_date= '2000-1-1 ', @phone_code= '13826793562 ',@post_code= '527200 ',@email= '[email protected] ',
@address= 'address ',@gd_school= '成人中专 ',@speciality= 'Computer '
exec KaoQinInsertUpdateEmployee
@emp_id ,@card_id ,@no_sign,@emp_name,@id_card,@position_id,
@sex, @job_id,@hire_date, @rule_id, @depart_id,@status_id, @photo,
@polity_id, @native_id,
@nation_id, @edu_id, @dorm_id, @birth_date,
@marriage, @gd_date, @phone_code, @post_code,
@email, @address, @gd_school, @speciality,
@insert_update,@message output
select @message
go
------解决方案--------------------
自定义变量不能是text,ntext,image,[email protected]
------解决方案--------------------
[email protected]
------解决方案--------------------
@photo image
存储过程里面不行.建议拿掉.