BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
shparber_m
Fluorite | Level 6

I've worked on dozens  SAS projects that write into SQL Server using native SQL connector.

I've always specified bulkload=yes in the libname and the performance was great!

Now I have a customer that only has ODBC connector to SQL Server (latest version 18)

I cannot find the equivalent - I've tried many options, but no luck, it works very slow....

Is there a way to make the ODBC write into SQL Server fast in bulk?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

In my experience using SAS/ACCESS Interface to ODBC with SQL Server, the default settings affecting loading are not optimal. The two LIBNAME (or CONNECT) settings that work well for me are DBCOMMIT and  INSERBUFF. Try DBCOMMIT = 0 and INSERTBUFF = 10000 and see how you get on.  

 

I've never bothered with BULKLOAD as tuning DBCOMMIT and  INSERTBUFF has always given good performance. But then again most of my loads are less than 1 million rows.

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

In my experience using SAS/ACCESS Interface to ODBC with SQL Server, the default settings affecting loading are not optimal. The two LIBNAME (or CONNECT) settings that work well for me are DBCOMMIT and  INSERBUFF. Try DBCOMMIT = 0 and INSERTBUFF = 10000 and see how you get on.  

 

I've never bothered with BULKLOAD as tuning DBCOMMIT and  INSERTBUFF has always given good performance. But then again most of my loads are less than 1 million rows.

shparber_m
Fluorite | Level 6

Excellent! 

INSERTBUFF works like a charm!

 

libname sqllbr odbc
NOPROMPT="DSN=ODBC_Name;UID=username;PWD=password;DATABASE=DB_Name;SCHEMA=dbo;" INSERTBUFF=32767
;

 

Thanks a lot!

 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 447 views
  • 4 likes
  • 2 in conversation