Storing "BLOB" data

  • We have a third part app that needs to store a PDF file in a sql 2008 database. I recommended using varbinary(MAX) but the app doesn't recognize that type. The only choice I see is to use the "text" datatype which has been been deprecated. Are there any other options I'm missing?

    TIA,

    Barkingdog

  • the app probably recognizes the TEXT or IMAGE datatypes.

    I've got applications that *think* they are storing in an TEXT column or an IMAGE data field , but i had converted the actual datatable to varchar(max) or varbionary(max) field swith no ill affects so far;

    saves RTF documents in a TEXT-migrated-to-varchar(max) just fine,a nd the same with a bunch of icon columns that were IMAGE but i changed to varbinary(max) fields.

    you could try doing the same and confirm whether or not the driver it's using to connect to SQL server has issues or not.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (12/2/2011)


    the app probably recognizes the TEXT or IMAGE datatypes.

    I've got applications that *think* they are storing in an TEXT column or an IMAGE data field , but i had converted the actual datatable to varchar(max) or varbionary(max) field swith no ill affects so far;

    saves RTF documents in a TEXT-migrated-to-varchar(max) just fine,a nd the same with a bunch of icon columns that were IMAGE but i changed to varbinary(max) fields.

    you could try doing the same and confirm whether or not the driver it's using to connect to SQL server has issues or not.

    Caution:

    “ntext, text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.”

  • Barkingdog (12/2/2011)


    We have a third part app that needs to store a PDF file in a sql 2008 database. I recommended using varbinary(MAX) but the app doesn't recognize that type. The only choice I see is to use the "text" datatype which has been been deprecated. Are there any other options I'm missing?

    TIA,

    Barkingdog

    Until you can get them to recognize VarBinary(MAX), I would recommend image for this storage. It's what it was originally meant for. Text can mess with formatting and data headers, as it's meant to be searchable via secondary functions.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • Evil Kraig F (12/2/2011)


    Barkingdog (12/2/2011)


    We have a third part app that needs to store a PDF file in a sql 2008 database. I recommended using varbinary(MAX) but the app doesn't recognize that type. The only choice I see is to use the "text" datatype which has been been deprecated. Are there any other options I'm missing?

    TIA,

    Barkingdog

    Until you can get them to recognize VarBinary(MAX), I would recommend image for this storage. It's what it was originally meant for. Text can mess with formatting and data headers, as it's meant to be searchable via secondary functions.

    Second the motion on that one. Storing binary data in Text datatype columns can cause all kind of problems.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply