SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
sassharp
Calcite | Level 5

proc sql;

  connect to sqlsvr(dsn=xxx user=yyy pwd='zzz');

  execute (truncate table base.monthlydata) by sqlsvr;

  disconnect from sqlsvr;

  quit;

error in log

ERROR: CLI execute error: [DataDirect][ODBC SQL Server Driver][SQL Server]Cannot find the object "monthlydata" because it does not

       exist or you do not have permissions.

when I check the sqlsvr side the monthlydata table exists.

6 REPLIES 6
Hima
Obsidian | Level 7

Did you check if you have the permissions to truncate the table and have you checked if you can query on that table?

sassharp
Calcite | Level 5

I checked the table is there.  I queried the table also Hima.

andreas_lds
Jade | Level 19

sassharp wrote:

I checked the table is there.  I queried the table also Hima.

And you have the required permissions to perform a truncate on the table?

Learner_SAS
Calcite | Level 5

This is the problem with permission . I beleive this user in coonection  does not have that permission for DDL. (truncate).

sassharp
Calcite | Level 5

I can delete table, drop table from SAS side. Why not truncate?

Vish33
Lapis Lazuli | Level 10

yeah..u will be having access to delete or drop a table from SAS side, but when u r trying to connect to external data base (sqlserver). you might not be having access to truncate a table or delete a table. only DBA's or database developers will be having access to truncate or delete the table.

Regards,

vishnu

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 1513 views
  • 0 likes
  • 5 in conversation