Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2010
    Posts
    21

    Question Unanswered: storing Byte Array in SQL 2005 size problem

    hi, i am facing a problem storing byte array into the database.
    i am working on a project to store multimedia files storage. so the size of files maybe upto 2GB. when i convert the files ranging 100 mb from 1 mb it works fine for them and also below. but when i try to convert a large big file, it converts it for me in byte array.
    but the byte array can not be stored in sql database.

    i have a table in sql name Tbl_video Varchar(max)

    note the vb.net code to store the file below 200 mb works fine. but dont know why, whn i try to put big files of bytes it just can not allow and i get error. e.g while storing a movie of 700mb

    Exception of type 'System.OutOfMemoryException' was thrown.

    plz help...

  2. #2
    Join Date
    Dec 2010
    Posts
    21

    Question HELP: want to store >1gb data in to sql server but memory is <1gb

    hi @ all.
    for my project, i m facing a problem , that when i convert my data into a byte array that is more than 700mb to 2gb, i get error every time.
    because my ram is <1gb.

    i just want to know the anyone alternative so that by using this RAM i can still able to store that huge data.

    beuz byte array has Tobe converted and loaded into RAM before inserting it to the database so i get that error every time.

    i also get the error "server timeout."

    please i want to get that help im using sql-2005 Varbirnay(max)
    .

    *NOTE*
    my project works well for all data types of files and any length between 1b to (amount of memory available)

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Your client application can't handle that much data for some reason. The error message 'System.OutOfMemoryException' is thrown by the client, not by the SQL Server.

    One obvious choice would be to handle the file in smaller parts. Store them as multiple rows in the table, then retrieve them and write them to disk in sequence.

    Another possibiltiy to allow you to handle the whole file in one piece mght be to use x64 code, but this is a very sloppy solution. It gets the job done, but it makes your application much more of a "resource hog" and limits it to running only on x64 systems.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #4
    Join Date
    Dec 2010
    Posts
    21
    Quote Originally Posted by Pat Phelan View Post
    Your client application can't handle that much data for some reason. The error message 'System.OutOfMemoryException' is thrown by the client, not by the SQL Server.

    One obvious choice would be to handle the file in smaller parts. Store them as multiple rows in the table, then retrieve them and write them to disk in sequence.

    Another possibiltiy to allow you to handle the whole file in one piece mght be to use x64 code, but this is a very sloppy solution. It gets the job done, but it makes your application much more of a "resource hog" and limits it to running only on x64 systems.

    -PatP


    look i want to store more than 1gb file in the sqlserver 05...
    from client side towards the server...

    i want to know some good solution that wud help me to store that much bigger file in the database..
    yet in single field...

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Use the same method that I suggested with WriteText and ReadText to get around your hardware limitations.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #6
    Join Date
    Dec 2010
    Posts
    21
    Quote Originally Posted by Pat Phelan View Post
    Use the same method that I suggested with WriteText and ReadText to get around your hardware limitations.

    -PatP
    when i convert the 1gb file into byte array i take huge amount of space in the RAM.
    is there any wayto store that same file chunk by chunk in the same field??

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by awaisdar001 View Post
    when i convert the 1gb file into byte array i take huge amount of space in the RAM.
    is there any wayto store that same file chunk by chunk in the same field??
    I must not understand your question correctly. That is exactly what can/should happen when you implement my previous suggestion using WriteText and ReadText.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  8. #8
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Let's see...I'm gonna build a VPC of the oldest version, and allocate 32MB to RAM for this virtual device. Then, I'm gonna try to open a 2GB file using Notepad on that machine... By the way, does anybody know how to fit an 8x14x26 into 2x4x10?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Tags for this Thread

Posting Permissions

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