Help using Base SAS procedures

Error in log

Reply
Frequent Contributor
Posts: 110

Error in log

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.

Regular Contributor
Posts: 233

Error in log

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

Frequent Contributor
Posts: 110

Error in log

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

Super Contributor
Posts: 345

Error in log

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?

New Contributor
Posts: 2

Error in log

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

Frequent Contributor
Posts: 110

Error in log

Posted in reply to Learner_SAS

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

Frequent Contributor
Posts: 117

Error in log

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

Ask a Question
Discussion stats
  • 6 replies
  • 222 views
  • 0 likes
  • 5 in conversation