BookmarkSubscribeRSS Feed
ilikesas
Barite | Level 11

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

4 REPLIES 4
art297
Opal | Level 21

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

 

ilikesas
Barite | Level 11

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 ?

ankit___gupta
Quartz | Level 8

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.

Kurt_Bremser
Super User

.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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 5774 views
  • 0 likes
  • 4 in conversation