Click here to Skip to main content
16,013,082 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get list of all temp tables names and using in storeproc in sql DB
Posted
Comments
OriginalGriff 27-Mar-15 4:13am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps if you give us an example of what you are trying to do, and explain why it is giving you difficulties?
Use the "Improve question" widget to edit your question and provide better information.

1 solution

FYI All the temp tables saved in tempdb.

you can try this query to list all the temp table which are using in stored procedures.

SQL
select name from tempdb.sys.tables A WHERE  EXISTS (
SELECT o.name
 FROM sys.sql_modules m
      INNER JOIN
      sys.objects o
        ON m.object_id = o.object_id
WHERE m.definition LIKE '%' + A.name + '%'
)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900