Create procedure Sp_InsertStudentDetails
@Adno int,@First_name varchar(30),@Last_name varchar(30),@Gender varchar(10),@Dateof_birth Date,@Dateof_joining Date,@Father_name varchar(30),@Mother_name varchar(30),@Occupation varchar(20),@Branch varchar(10),@Parent_mobilenumber bigint,@Religion varchar(10),@Caste varchar(20),@House_number varchar(10),@Village_name varchar(20),@District_name varchar(20),@State_name varchar(20),@Pincode int,@Academic_year varchar(10),@Image_file varbinary(MAX),@Section Varchar(20)
as
begin
Insert into Student_Registration(Admission_number,First_name,Last_name,Gender,Dateof_birth,
Dateof_joining,Father_name,Mother_name,Occupation,Branch,Religion,caste,House_number,
village_name,District_name,State_name,pincode,Academic_year,image_file,Parent_mobilenumber,
Section)values(@Adno,@First_name,@Last_name,@Gender,@Dateof_birth,@Dateof_joining,
@Father_name,@Mother_name,@Occupation,@Branch,@Parent_mobilenumber,@Religion,@Caste,
@House_number,@Village_name,@District_name,@State_name,@Pincode,@Academic_year,
@Image_file,@Section)
End
When i execute the query above i'am getting the error below but when accidentally the database got changed it has executed without any errors.
<pre lang="sql">Msg 257, Level 16, State 3, Procedure Sp_InsertStudentDetails, Line 5
Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.</pre>