SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

import .sql file

Super Contributor
Posts: 459

import .sql file



I was sent .sql files which I need to work on, but I don't know how to open them - when I went to the import wizard I didn't see a ".sql" file option. I was searching on the internet and it was saying that I need to connect to the sql server (if I understood correctly) but I don't have any such thing on my computer. Is there a way for me to import these files?


Thank you

Posts: 8,149

Re: import .sql file

I would guess that the file is merely a text file that contains a sql querry to some database. It would only be useful if it contained the link to the database and you had access to that database. You should be able to view the querry using any text editor (e.g., notepad)


Art, CEO,


Super Contributor
Posts: 459

Re: import .sql file

Hi art297,


Indeed I was able to open the file with notepad and so instructions as well as raw data. I tried the suggestions below but it won't work. I personally don't have the original data and I don't have SQL, so I guess that the only option is for the sender to export the data in csv form ?

Posts: 46

Re: import .sql file

Most probably it is an SQL dump. It contains essentially SQL statements (create table, insert into...).

If you put the contents of the file inside a PROC SQL;   and   QUIT;   you have some chances that you can run it.

But also possible, that you have to edit this code.


A "supported way" to import such a file is to import it with a native tool (Oracle and maybe MySQL and PostgreSQL support this), then access that database with the appropriate SAS Access engine. Or make an export to a text file.

Super User
Posts: 9,914

Re: import .sql file

.sql files are the SQL equivalent of SAS .sas program files. It may be that they contain data in text form (like a SAS data step with datalines), and are therefore more or less self-sufficient to create data.

Open the file with a text editor, copy/paste to SAS and see what you can do.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 4 replies
  • 4 in conversation