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

import .sql file

Reply
Super Contributor
Posts: 441

import .sql file

Hi,

 

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

PROC Star
Posts: 7,471

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, AnalystFinder.com

 

Super Contributor
Posts: 441

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 ?

Contributor
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: 7,771

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
Ask a Question
Discussion stats
  • 4 replies
  • 603 views
  • 0 likes
  • 4 in conversation