Cannot process the object

I have a job that runs every half hour.

It calls a procedure that has the following code
CREATE TABLE ' + @v_tablename  + ' (key_field INT IDENTITY, data NVARCHAR(MAX))'
EXEC sp_executesql @v_sql

SET @v_sql = '
SELECT * INTO ' + @v_tablename + '1' + '
FROM OPENQUERY(' + @v_connectionstring + ',
''SET FMTONLY on {call [' + @v_database_name + '].' + @v_name + '}'')'
EXEC sp_executesql @v_sql

The procedure runs fine most of the time, but every once in a while it'll error out with the following error message:

Cannot process the object 'SET FMTONLY ON {call [XXX].dbo.sp_XXX}'
The OLE DB provider "SQLNCLI" for linked server "xx" indicates that
either the object has no columns or the current user
does not have permissions on that object. [SQLSTATE 42000] (Error 7357).  
The step failed.

Like I said, the job runs fine most of the time, my Ad Hoc Distributed Queries is enabled.
Any ideas why it doesn't work sometimes?

Who is Participating?
DB_GIRLConnect With a Mentor Author Commented:
It seems like other people have similar issue. I was able to resolve the issue by setting the retrys for the job. It seems that there is a connectivity issue every once in a while (job fails) but it gets fixed on its own in a second. So I set my job to retry in a minute, and it never reported failure after that.
DBAduck - Ben MillerPrincipal ConsultantCommented:
Well, you are using ODBC calling style with SQLNCLI or SQLOLEDB, and that may cause some heartburn for your process.

you should just use


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.