Can't get a Job to execute properly...
-
Thursday, August 23, 2012 2:42 AM
Shouldn't a SQL Agent Job be capable of creating a global temp table?
The Job is a T-SQL job step with the owner (Administrator) being a member of sysadmins.
Odd...the job doesn't fail, but it doesn't create the global temp table.
Any ideas?
Thank you.
---------------- GeorgeS, aka "SQLPadawan"
All Replies
-
Thursday, August 23, 2012 4:15 AM
A global temp table only exists for the life of the session. Therefore, if the SQLAgent job completes before another session can start working with that table the global temp table is automatically dropped. Global temp tables don't persist forever. In your case you may be better to use a normal table and assign some sort of key that will help identify the records being used to the other session.
- Proposed As Answer by EitanBlumin Thursday, August 23, 2012 7:14 AM
- Marked As Answer by George Squillace Thursday, August 23, 2012 6:05 PM
-
Thursday, August 23, 2012 6:06 PM
Perfect. OF COURSE this make sense now.
What wasn't obvious is that the Agent sessions closes upon job completion.
Thank you!
---------------- GeorgeS, aka "SQLPadawan"

