CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2009
    Posts
    596

    How Big of a File Can I Process?

    Hey everybody.

    I'm looking into doing a project in which I would have to import some text files into a MSSQL database. I tried opening one of the files in notepad to take a look at its format and Notepad said it couldn't open it because it was too big. So I tried to open the file with WordPad and it's too big for WordPad I think because the blue busy circle spins forever. I had to run task mangager to stop WordPad, it turns out that WordPad was not responding. So too big for either app to open it seems. Looking at properties of the file, i see that the file size is 0.99 GB. Will I be able to import this file into a table with C#?

  2. #2
    Join Date
    Oct 2004
    Location
    Rocket City
    Posts
    220

    Re: How Big of a File Can I Process?

    Take a look at the IO.Stream classes such as FileStream. I believe all the internal counters use Int64, which is very, very big (Int32 max = 2GB). We have used Stream classes on files over 2GB with no problems.

  3. #3
    Join Date
    Dec 2009
    Posts
    596

    Re: How Big of a File Can I Process?

    Thanks Zip.

  4. #4
    Join Date
    Jun 2007
    Posts
    12

    Re: How Big of a File Can I Process?

    If you read a file as a stream, it can be as large as you like. I searched for a size limit to MS SQL's nvarchar, and couldn't find one.

    When it comes to displaying your text, you will be limited unless the editor supports paging (not all of the file is held in memory at once). The RichTextBox control can hold about 2gb.

  5. #5
    Join Date
    Oct 2004
    Location
    Rocket City
    Posts
    220

    Re: How Big of a File Can I Process?

    max indicates that the maximum storage size is 2^31-1 bytes (2 GB).
    Ref from MSDN: char and varchar (Transact-SQL)

    SQL storage is a different arena than IO.Stream.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured