Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    28

    Unanswered: Load a doc to VARBINARYT(MAX) FileStream

    Hi All

    Im trying to load a document into a column defined as data type VARBINARY(MAX) in a FileStream database. However, I keep get the following error. Please can someone tell me what im doing wrong?

    Thanks

    Code:
    DECLARE @img AS VARBINARY(MAX)
     
    -- Load the image data
    SELECT @img = CAST(bulkcolumn AS VARBINARY(MAX))
    FROM OPENROWSET(BULK 'C:\Users\C# Trader\Documents\Test.doc', SINGLE_BLOB ) AS x
               
    -- Insert the data to the table          
    INSERT INTO Items (ItemID, ItemNumber, ItemDescription, ItemImage)
    SELECT NEWID(), '1002','Mouse', @img
    Code:
    Msg 3634, Level 16, State 1, Line 34
    The operating system returned the error '0xc000003a(failed to retrieve text for this error. Reason: 15105)' while attempting 'NtCreateFile' on 'C:\SQL Server Databases\DB1_FileGroup1_FS\cdea2ac1-2cea-433b-8117-8d6407871e39\922109cf-b0c6-4991-90db-0f6c2c6ebda5\00000014-00000284-00bb'.
    The statement has been terminated.

  2. #2
    Join Date
    Jun 2010
    Posts
    28
    Its now been resolved. I found out that I accidently deleted some of the files within the actual filestream folder.

    Any future appends I tried to make into the table became automatically invalid as SQL Server didnt like it.

    I had to drop the table then re-create it completely and this resolved the problem.

    I can now append records to the varbinary(max) column.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •