Re: retrieve table properties through query?

From: Keith Kratochvil (sqlguy.back2u_at_comcast.net)
Date: 04/19/04


Date: Mon, 19 Apr 2004 12:19:35 -0500

This should get you started:

USE northwind
GO
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Customers '

There are lots of helpful INFORMATION_SCHEMA views. Look within Books Online (within your SQL Server program group) for more information.

-- 
Keith
"David Hepburn III" <null@null.com> wrote in message news:40840893.20408@null.com...
> 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
> 


Relevant Pages

  • Gedeckter Index wird bei Abfrage nicht verwendet
    ... zum Üben verwende ich in Northwind einen Index mit city, companyname, ... from customers ... Next by Date: ...
    (microsoft.public.de.sqlserver)
  • Re: Continious forms
    ... What Northwind db does is what I have, but what I want is to have the list ... of the customers on a continious form not on a singl form like in the ... so if anyone has a suggestion. ... >> what I want to have is a list of Clients and for each one of them, ...
    (microsoft.public.access.formscoding)
  • Re: Need help putting this query together
    ... Here's an example from Northwind: ... Customers c ... Columnist, SQL Server Professional ... Thanks for the great and quick response, I was wondering though, how would you display all the other months with a 0 for a count. ...
    (microsoft.public.sqlserver.programming)
  • Re: Using a comma delimited array in a where clause
    ... you will have to use IN clause. ... use northwind ... following syntax. ... select * from customers where customerid in ...
    (microsoft.public.sqlserver.programming)
  • query to list field data types
    ... field names, field data types, field lengths, index names, ... if we queried the Customers table in the MS ... ContactName, nvarchar, 30, nulls=yes ...
    (microsoft.public.sqlserver.mseq)