April 17, 2013 at 4:42 pm
How do I amend this to only show me tables,
select DISTINCT TABLE_NAME from INFORMATION_SCHEMA.COLUMNS
WHERE COLLATION_NAME <> 'SQL_Latin1_General_CP850_BIN'
AND TABLE_NAME <> 'syn%' order by TABLE_NAME ASC
April 17, 2013 at 4:58 pm
Join it to the INFORMATION_SCHEMA.TABLES view by TABLE_NAME and filter TABLE_TYPE = 'BASE TABLE'.
Or add the following in the WHERE CLAUSE
exists(select 1 from INFORMATION_SCHEMA.TABLES t WHERE t.TABLE_NAME = c.TABLE_NAME and a.TABLE_TYPE = 'BASE TABLE') -- This assumes that you alias INFORMATION_SCHEMA.COLUMNS with a c in the FROM clause.
April 18, 2013 at 2:07 pm
Thanks didn't know about the tables one..cheers
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply