BookmarkSubscribeRSS Feed
Citrine10
Obsidian | Level 7

hi there

 

i am looking for a Proc SQL code to transfer a table from SAS to Ms SQL.

 

Please assist, I can not find any code anywhere

2 REPLIES 2
andreas_lds
Jade | Level 19

@Citrine10 wrote:

hi there

 

i am looking for a Proc SQL code to transfer a table from SAS to Ms SQL.

 

Please assist, I can not find any code anywhere


Then you should visit an eye specialist, i am 100% sure that code exists showing how to use insert to copy data from one dataset to another. Depending on the way the connection to ms sql is established, using proc copy could be faster.

Tom
Super User Tom
Super User

Are you creating a new table in the remote database? Or appending data to an existing table?

 

Usually PROC APPEND is the easiest/fastest way. 

Create a libref that points to the schema in the remote database and then use PROC APPEND to copy the data.

If the target table does not exist then the FORCE option will tell SAS to create the table first.

libname mydb odbc ..... ;
proc append base=mydb.target_table data=mylib.mydataset force;
run;

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 631 views
  • 0 likes
  • 3 in conversation