Can anyone tell me if there's a query command that will
return information about a table's properties, such as
field names, field data types, field lengths, index names,
etc?
For example, I'm looking for output that would show the
following, if we queried the Customers table in the MS
Northwind SQL DB:
CustomerID, nchar, 5, nulls=no
CompanyName, nvarchar, 40, nulls=no
ContactName, nvarchar, 30, nulls=yes
etc...
Thanks!!!
David
On Mon, 19 Apr 2004 10:04:25 -0700, David Hepburn III wrote:
>Can anyone tell me if there's a query command that will
>return information about a table's properties, such as
>field names, field data types, field lengths, index names,
>etc?
>For example, I'm looking for output that would show the
>following, if we queried the Customers table in the MS
>Northwind SQL DB:
>CustomerID, nchar, 5, nulls=no
>CompanyName, nvarchar, 40, nulls=no
>ContactName, nvarchar, 30, nulls=yes
>etc...
>Thanks!!!
>David
Hi David,
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Customers'
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||hi david,
you can make use of any of the following system stored procedures.
sp_columns <table_name> --to find column definition
sp_helpindex <table_name> --to find indexes
sp_help <table_name> complete table definition including indexes,pks/fks
etc.
Vishal
vgparkar@.yahoo.co.in
No comments:
Post a Comment