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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 401 views
  • 0 likes
  • 3 in conversation