BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12
I have table in SQL server and I have one SAS WORK data set. Both are similar structure with same data type.

Now I would like to know the different ways to insert SAS dataset observation in SQL table from SAS.

Is below code the right way to insert records in SQL server table?

e.g.

Proc append data=sqllibrary.table data=sas_work_dataset force;
Run;
2 REPLIES 2
SASKiwi
PROC Star

PROC APPEND is the easiest way to insert new rows into an external database table. Have you tried it?

Reeza
Super User

PROC APPEND is one of the fastest because it's just a proc to move data, a data step or SQL procedure can also be used to transform data so it copies data line by line. APPEND copies data in blocks.

I'm assuming you have the bulkload option set up as well on your server connection.

 


@Babloo wrote:
I have table in SQL server and I have one SAS WORK data set. Both are similar structure with same data type.

Now I would like to know the different ways to insert SAS dataset observation in SQL table from SAS.

Is below code the right way to insert records in SQL server table?

e.g.

Proc append data=sqllibrary.table data=sas_work_dataset force;
Run;

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 877 views
  • 2 likes
  • 3 in conversation