> i want to retrieve the column names of the table using coldfusion. The
> database we r using is SQL server 7. i know how to get column names from
> query analyzer. but thru coldfusion is it possible to get them.

If you want to do it correctly for SQL Server 7...

select Column_Name
from Information_Schema.Columns
where Table_Name='myTable'

Using Information_Schema, you can get all sorts of information about the
columns... the data type, whether it's NULLable, size, numeric precision.

Also, using SysColumns and SysObjects, you can find out which column is the
primary key.

select SysObjects.Name, SysColumns.Name
from SysColumns, SysObjects
where SysColumns.ID=SysObjects.ID and (SysColumns.status & 128)=128 and
SysObjects.Name='myTable'

HTH

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to