Hello All,I have stored procedure which is accepting a file as type image. Inside this SP, I am calling another stored procedure which is saving this file in a table. Here is the code snipit:ALTER PROCEDURE spMainStoredProcedure( @MyID as int, @MyName as varchar(100), @MyFileName as varchar(255), @MyFileDocument as image,)asbegin declare @Identity int insert into MyTable (MyID, MyName) values (@MyID, @MyName) set @Identity = @@Identity exec spUploadFile @MyFileID = @Identity, @FileName = @MyFileName, @FileDocument = @MyFileDocument end
When I call spMainStoredProcedure from my ASP.NET page, I get an error that @Identity is null. It means that it didn't even execute the insert statement. So apparently, the problem is in passing the file as image. But if I call spUploadFile directly from my web page and pass all the parameters, everything works fine.Please comment.