BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Can I create table on SQL server using SAS?
How?
I like physical create tables, and insert the data.
I can connect using ODBC.
Not sure how to create tables on SQL server using ODBC connection.
Any suggestions?

Thanks
3 REPLIES 3
ChrisHemedinger
Community Manager
Hi,

You would need to use SAS/Access to ODBC (or OLEDB) to define a SAS library that maps to your SQL Server database. Then you should be able to create data sets using any of the usual SAS methods (PROC SQL, DATA step, etc) that reside in that library, and therefore the SQL Server database.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
bobyang
Calcite | Level 5
but I got problem to load large sas data set (88 million rows) to SQL server.
it alway reaches to 65457 and then stop. there is NOT sas log error or warning. just stuck here and on the SQL server side you see the talbe is NOT growing only has 65457 records.
On the unix sas server side. We have set up the ODBC. INI file correctly and set up a libname as follow in our SAS code and the library has been successfully established.
libname sql_side sqlsvr dsn=ACESQL uid=8FN pwd=XXXXXX schema=dbo ;
we use proc copy to load sas data to sql server, but whenever reach to 65547 and then it stop.
It seemed that someone told me to use a “commit” function or command to let sql server accept and commit the records first and then it can load more?? Please help!!
Ksharp
Super User
I think obs 65458 contains some illegal character in that table, So when SAS transcode it fail,SAS will stop read in the obs after it.I meet this situation frequently.
So Check the dataset' s variable attribute. to see whether the length of some variables is
very long (e.g. 32700) or is zero.
You 'd better to open the table to see content to find whether there are some strange character.
Then drop these variables , you will successfully imported.



Ksharp

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 1481 views
  • 0 likes
  • 4 in conversation