-2

I have a very large sql backup file (~ 22 gb). Does anyone know how can I read it from R?

ilker_arslan
  • 637
  • 3
  • 7
  • 17
  • SQL Server backup file? (The ANSI SQL language has no back-up...) – jarlh Nov 30 '16 at 11:04
  • 1
    If the **backup** is in the natural form used by your DBMS, you have no chances to read it from a different application (well, I exaggerated by saying _no chances_; let's say that it will take you till your retirement). If, on the other hand, the backup is in (for instance) XML (never saw something like that, but let's assume), you would simply need to load the 22GB into memory, parse it, and read it. – FDavidov Nov 30 '16 at 11:11

1 Answers1

1

(Assuming you are using SQL Server here. But if it is a backup of another database, the same option is probably available).

The best solution is probably:

  1. Restore the backup file into a (new) Database. This is pretty simple to do: this question covers it (for SQL Server 2008). You can also get the free SQL Server Express if you don't own a version of SQL Server.

  2. Connect to the database using RODBC. There is a quick start example here.

Note: there are some proprietary tools that read SQL server backup files directly (also mentioned in the first link above). But if you want to work with the data in R, being able to access it through the standard RODBC interface will be much more convenient.

Community
  • 1
  • 1