Link to home
Start Free TrialLog in
Avatar of Greens8301
Greens8301

asked on

temporary tables in sql server 2005 how persistent is it

on a sql agent job created 2 steps
step1 creates temporary tables by running sql script
step2 reads these temporary tables, does some processing and writes to a new table

what i found was, as soon as the step1, exists, the temporary tables disappears

how persistent are the temporary tables. can it be used across different sessions

Thanks
ASKER CERTIFIED SOLUTION
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Greens8301
Greens8301

ASKER

Does global temporary table work across steps in the SQL Agent job

"ALL connections using them go out of scope"
When step1 completes, there are no connects to the tables. Does this constitute ALL connections
Then when step2 starts, (probably a different session id), can it see GTT

Thanks

yes, in that case it would go out to scope (even the global)...why not use a user-table instead?