I want to find all column names in all tables in all databases. Is there a query that can do that for me?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this:
With resulting column names this would be:
Or for more detail:
EDIT
Here is a basic example to get all columns in all databases:
EDIT SQL Server 2000 version
EDIT
Based on some comments, here is a version using
sp_MSforeachdb: