I have an SQL 2005 database and I know that in the database there is a table which has got some xml strings in it. How can I find this table(s)?
相关问题
- Illegal to have multiple roots (start tag in epilo
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
If the fields are actually of type XML, then this query will give you what you're looking for:
Marc
Run this:
The first result set will have one row per character column in the database:
select distinct 'table.column' from table where column like '%<%/>%' union
Take that resultset, snip off the last union, and run the resultset as a SQL statement. It'll bring back the table name and column name for any column that has one or more rows that look XML-ish.
Edit: this is from memory; the join to systypes and the type names may be wrong, so select from systypes and check.