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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5815 views
  • 0 likes
  • 4 in conversation