Re: Meta data of query?

From: LCaffrey (lxc_at_eosys.ie)
Date: 07/11/04


Date: 11 Jul 2004 13:59:58 -0700

Thanks guys, this is very nice...

A few points...

I find that ...
SELECT (col_list) from personal_details where 1 = 0
... is a much more effective way of getting the query description.

Dan, some points w.r.t. your suggestion...
1. > WHERE
> OBJECT_ID(QUOTENAME('dbo') + '.' + QUOTENAME(TABLE_NAME)) =
> OBJECT_ID('tempdb.dbo.#MetaData')

...I presume that this is a typo and that you meant...

> OBJECT_ID(QUOTENAME('dbo') + '.' + QUOTENAME(#MetaData)) =

However, this is not possible because '#MetaData' is not the actual
name of the temp table.
The only way I can get around this is to use '... LIKE '#MetaData%'
which works fine.

2. Each column must be named explicitly or resolve to a proper name
(e.g. aggregate columns must have a name - I haven't tried complex
queries with inline views and group by, etc...

3. Embedded strings must be gsub'ed.

Thanks for your help

Dynamically generated web pages based on user queries, here we go....

Liam Caffrey