Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2004
    Posts
    28

    Unanswered: Insert huge text file into SQL Server

    I am writing a .NET service, and I need to insert files in a SQL DB for temporary storage.

    I have never inserted a file into a SQL database before. I am thinking about using the image field type. Has anyone done this before? How did you do it?

  2. #2
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    No Don't Do it!!

    Temporary? Why do it when it's easier to save a link to the location and save the file to a directory.

    Just because something can be done does not say it should be!
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  3. #3
    Join Date
    Sep 2004
    Posts
    28
    Well, I'm a consultant and the guy paying my fee wants it like that. Mainly, I imagine, so his DBA's can manage tables instead of managing file directories.

    So has anyone done this before?

  4. #4
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    Then as one consultant to another tell the guy it's not worth the hassle.

    However I'll point you to an article it concerns images but gives you the jist of what needs to be done.
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  5. #5
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    Sh*t forgot the link

    http://www.sqlteam.com/item.asp?ItemID=986

    Sorry about that
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Unless there is compelling (non-technical) reason to do this, as a consultant you need to convince the client that this is a bad idea. From a technical perspective, it is a disaster in search of a new victim and your client seem to be waving and yelling "pick me, pick me!"

    If there is some compelling, non-technical reason to do this, then you can store files as data in MS-SQL, and the IMAGE datatype is the most appropriate way to do it.

    -PatP

  7. #7
    Join Date
    Sep 2004
    Posts
    28
    I appreciate the warnings about this and thanks for the link.

  8. #8
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    Evanhand -- Remember as a Consultant you have a responsibility to Yourself to not drop your reputation into the shitter, and of course your client.

    You the consultant should not be dictated to you are the "expert". And should be following Good and valid logic.

    I am assuming you are new to consulting and apologise if this is not the case.

    -- My 2 cents thats all
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  9. #9
    Join Date
    Sep 2004
    Posts
    28
    Again, I appreciate your input and advice. FYI I am not new to consulting.

    The reason we are going to use the DB to store the files is for security. These are delimited files from 16 other databases going into the database I created for a central base of client - participant information. The files contain all sorts of personal information including SSN's, addresses and medical and dependant history just for starters.

    Legal reasons / corporate policy requires this information to be stored as securely as possible. I realize file servers can be locked down but around here even network admins do not have passwords to client information databases.

    Thanks again!

  10. #10
    Join Date
    Dec 2004
    Location
    York, PA
    Posts
    95
    Rather than store the Text I'd import it into a DB create a table for it

    After all that is More secure than a Text file which as has been explained is fraught with "danger".
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

Posting Permissions

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