G
Guest
Hello,
I have written code in ASP.net 2.0 to insert the values in a SQL
Server Database. the code is as follows
Dim addemp As System.Data.SqlClient.SqlCommand = New
System.Data.SqlClient.SqlCommand("INSERT INTO Department
(department_name,lastname,firstname,title,hiredate,reportsto,photo)
values(@departmentname,@lastname,@firstname,@title,@hiredate,@reportsto,0x0);"
& "SELECT @identity=SCOPE_IDENTITY();" & "SELECT @pointer=TEXTPTR(photo) from
department where department_id=@identity", con)
Now the SQLException is raised as :
'SCOPE_IDENTITY' is not a recognized function name.
I want to know if the syntax of the above statement is correct or not also
how to deal with this exception
Thank you
I have written code in ASP.net 2.0 to insert the values in a SQL
Server Database. the code is as follows
Dim addemp As System.Data.SqlClient.SqlCommand = New
System.Data.SqlClient.SqlCommand("INSERT INTO Department
(department_name,lastname,firstname,title,hiredate,reportsto,photo)
values(@departmentname,@lastname,@firstname,@title,@hiredate,@reportsto,0x0);"
& "SELECT @identity=SCOPE_IDENTITY();" & "SELECT @pointer=TEXTPTR(photo) from
department where department_id=@identity", con)
Now the SQLException is raised as :
'SCOPE_IDENTITY' is not a recognized function name.
I want to know if the syntax of the above statement is correct or not also
how to deal with this exception
Thank you