tags:

views:

158

answers:

3

any software or source code can used?

  • i have many table i database 200+ table and my boss give some project and requirement and not give information for table but give field name and i would like to find field name for query some condition but i don't know this field in where table and i to solved its
+1  A: 

use database_name

Sp_help table_name

This stored procedure gives all the details of column, their types, any indexes, any constraints, any identity columns and some good information for that particular table.

Second method:

select column_name ‘Column Name’, data_type ‘Data Type’, 

character_maximum_length ‘Maximum Length’ from 

information_schema.columns where table_name = ‘table_name’

You can visit here for more details.

Kevin Boyd
A: 

I'm not positive what you're asking, but you can query the SysColumns table to search for field names across all tables.

SELECT obj.Name [TableName], col.Name [ColumnName]
  FROM SysColumns      AS col
 INNER JOIN SysObjects AS obj ON col.ID    = obj.ID
                             AND obj.XType = 'U'
 WHERE col.Name LIKE '%Price%'
A: 

Metadata about table structure is exposed in the Object Catalog Views:

select name from sys.columns where object_id = object_id('myTable');
Remus Rusanu