BookmarkSubscribeRSS Feed
VJ1
Calcite | Level 5 VJ1
Calcite | Level 5

Hi,

I have a sas data set. what I need to do is to push that dataset into SQL Server with new table name in SQL Server. can someone please help me in doing this ? it would be very helpful if someone provide the code for this.

 

I haven't used sas before but I have access to SAS and also I have access to Read & write data in SQL Server.

 

Thanks,

VJ

5 REPLIES 5
ccaulkins9
Pyrite | Level 9
Have you looked at the PROC SQL examples in the online documentation?
e-SAS regards,

VJ1
Calcite | Level 5 VJ1
Calcite | Level 5

No I haven't looked those. what i am looking is to push the dataset into SQL server using sas. since I don't know SAS I am looking for SAS Code for this. can you provide that ?

error_prone
Barite | Level 11

proc sql is a sas procedure.

 

The data you want to store in the database is currently stored in sas datasets?

Reeza
Super User

Set up a odbc connection to the server via control panel. 

https://support.sas.com/techsup/technote/ts765.pdf

 

Assign a libname to the server and then a simple dataset or proc datasets can be used to create the table. 

 

 

libname sqlsrv odbc dsn=myserv schema=dbo;

 

data sqlsrv.data;

set data;

run;

AhmedAl_Attar
Rhodochrosite | Level 12

VJ,

 

Do you know which version of

- SAS Software you have?

- Which SAS/ACCESS product you have (SAS/ACCESS to OLE DB/ODBC)?

 

Once you have answered the above two questions, then you can find sample code in the relavant documentation here

SAS/ACCESS 9.x for Relational Databases: Reference,

 

 

Note: There are no single code that works for all databases, therefore you shouldn't count on someone to provide you a working code for your database! Read the doc and adopt the code to your settings and environment.

 

Hope this helps,

Ahmed

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 Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 6689 views
  • 3 likes
  • 5 in conversation