?
Solved

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

Posted on 2011-03-04
4
Medium Priority
?
558 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 1000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

764 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