sqlTransaction Complete Error-dataype was image now varbinary(max)



Hi,

This is being called in a C# loop within an ado.net transaction from C# 1.1
code. It is used to write large file data to a SQL Server database in
chunks, rather than in one go.

I had the stored procedure below, which worked until the image datatype was
changed to varbinary(max).

Now I get the following error:

This SqlTransaction has completed; it is no longer usable

The stored procedure is here (NOTE this is the version that works with the
dataype set to image. If I change the datatype to varbinary(max), and
obviously change the field in the table as well, the code fails with the
error given above).

ALTER PROCEDURE [dbo].[FileUploadData_Upd]
@FileID Uniqueidentifier,
--@data varbinary(max),
@data image,
@append bit
AS

SET NOCOUNT ON
IF @append = 0
UPDATE dbo.FileUpload
SET Data = @data
WHERE FileId = @FileID;
IF @append = 1
UPDATE dbo.FileUpload
SET Data.write(@data,NULL,0)


Any help would be appreciated

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com
.



Relevant Pages

  • sqlTransaction Complete Problem-dataype change from image to varbi
    ... I had the stored procedure below, which worked until the image datatype was ... @FileID Uniqueidentifier, ... IF @append = 0 ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: sqlTransaction Complete Problem-dataype change from image to varbi
    ... chunks, ... I had the stored procedure below, which worked until the image datatype was ... IF @append = 0 ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: sqlTransaction Complete Error-dataype was image now varbinary(
    ... This means the first call will run fine when the @append is ... change the datatype back to image it all works fine. ... Phillip Johnson ... @FileID Uniqueidentifier, ...
    (microsoft.public.sqlserver.clients)
  • Re: string manipulation (bis)
    ... it append a f after the last digit. ... set fileId [open $fileName w] ... in your input string (as split will give you blank items in the middle of ...
    (comp.lang.tcl)
  • Re: Inserting Record to SQL Server
    ... It would be much faster, for execution speed, to write a stored procedure, in MS SQL Server, which 'append' the 'file' you mention, and, from your application, ask the db engine to run that stored proc. ... he is going in a loop until finisih reading the file and calling an insert for each record. ...
    (microsoft.public.dotnet.languages.csharp)

Loading