Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Create precedents don't just follow them
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

15
July

How Do I List All the Views in an SQL Database?

Recently while working with a client they asked, how does one list all the views within an SQL database that contains a specific field name?

To find all SQL views with a specific column name:

SELECT

   TABLE_NAME, COLUMN_NAME, DATA_TYPE

FROM INFORMATION_SCHEMA.COLUMNS

WHERE TABLE_NAME in

   (SELECT name

    FROM sysobjects

    WHERE xtype = 'V')

and COLUMN_NAME like '%enter the required field name here%'

ORDER BY TABLE_NAME, COLUMN_NAME


If you have any questions, or need any assistance, please do not hesitate to Contact Us

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

92 + 66 =