Question : Determine which table and columns a field is stored at the backend

:  Hi there:
  I am using RS2008 to generate reports against a online application which uses Sql server database. I feel sometimes I need to know the table and column a specific field is stored in the database.  How to get that piece of information?

 thanks

 Hui

Answer : Determine which table and columns a field is stored at the backend

There are ways to limit the results of SQL Profiler.  Get the results into a table so you can easily query it.  Be sure that database_id or DatabaseName is one of your columns in the trace.  Run the profiler for a very short time - just the duration of the report.  Then filter the query by database name, and use a where clause like this:

WHERE DB_Name(database_id) = 'MyDatabase'
   AND TextData Like '%ColumnName%'

ColumnName can be what you think might be a column in the report.

Random Solutions  
 
programming4us programming4us