Reputation: 144
I have a SQL Agent Job which claims to succeed, however doesn't ACTUALLY do what it is supposed to do. If I run the script inside on its own it does generate results.
I am using SQL 2014. The scrip used/inside the agent job is:
IF OBJECT_ID('TEMPDB..##RCCON','U') IS NOT NULL DROP TABLE ##RCCON
SELECT top 10 R.RC_C__ID as ConsentId
,dbo.clr_RC_CON(R.RC_CON__ID,'','') AS RC_CON
INTO ##RCCON FROM RC_CON R
The script works independently, but as a JOB yields no results.
Any suggestions please? Cheers
Upvotes: 0
Views: 86
Reputation: 82020
The ##RCCON evaporates when the SQL Agent Job is done. They only exist for the duration of the session.
Perhaps use [dbo].[RCCON] instead
Upvotes: 2