Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to reverse engineer are report from a third party application into SSRS, so that I can make some changes for our users.

I have captured the SQL that is used by the report, however the query references a Global Tempory Table that seems to be created at some point during the parameter entry, and dropped when the parameter screen is closed.

I have set Profiler to capture every event with no filters at all but still cannot find the table name anywhere except the query that accesses it.

I have tested creating and dropping my own tempory tables and this shows up in Profiler as expected.

Does anyone know why I cannot capture the SQL used to create this table?

FYI: the Database is 2005, but I'm using 2008 tools

share|improve this question

Although this application uses alot of inline SQL, the temp table is beign created within a stored proc.

This query found the stored procs that create the tables.

select O.[name], left(c.[Text], 1000) as Text, left(, 1000) as sp_sort
From sysComments c
  inner join sysobjects o
        on =
where c.[text] like '%##TABLENAME%'

And one of those was soon found in the profiler listing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.