Solved

What sql query can I perform to show me the field names?

Posted on 2011-03-04
4
537 Views
Last Modified: 2012-05-11
I am needing to run a query and get results based the field being equal to a particular value. However, I am not familiar with this database structure and need to view the individual names of the record fields. Is there a technique or query I can run in SQL 2008 that will give me this info?
0
Comment
Question by:jso2765
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 35040541
select column_name,* from information_schema.columns
 where table_name = 'YourTableName'
0
 

Author Comment

by:jso2765
ID: 35040556
Where would I find the table name?
0
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 250 total points
ID: 35040573
just do

DESCRIBE ;

or
try this

SELECT column_name,column_type,is_nullable,column_key,col  umn_default,extra FROM information_schema.COLUMNS WHERE
table_schema='' AND table_name=''
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35040593
You should know your database name, table name and column which you want to query.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question