twrehl
twrehl

Reputation: 1

Importing an .RPT (6 gigs) file into SQL Server 2005

I'm trying to import two seperate .RPT files into SQL, one is small, one is large. Both have issues with determining where the columns are seperated.

My solution for this was to import the file into access, define the columns and then save it as a txt file.

This worked perfectly.

The problem however is the larger file is 6 gigs and MS Access won't allow me to open it. When trying to change the extension to simply .txt and importing it into SQL, everything comes down under one column (despite there being 10) and there is no way to accurately seperate the data.

Please help!

Upvotes: -1

Views: 6568

Answers (2)

Veldmuis
Veldmuis

Reputation: 4868

If the file has column delimiters or fixed column widths you can try the following in SQL Management Studio:

Right click on a database, select "Tasks" and then "Import data...". This will take you through a wizard where you can define the source columns and map them to an existing or new table.

Upvotes: 0

mwolfe02
mwolfe02

Reputation: 24237

As Tony stated Access has a hard 2GB limit on database size.

You don't say what kind of file the .RPT file is. If it is a text file, then you could break it into smaller chunks by reading it line by line and appending it into temporary files. Then import/export these smaller files one at a time.

Keep in mind the 2GB limit is on the Access database, so your temporary text files will need to be somewhat smaller because the import will likely introduce some additional overhead. Also, you may need to compact/repair the database in between import/export cycles to reclaim space in the database; simply deleting the records is not enough.

Upvotes: 0

Related Questions