You will have to use a join on some system tables.

This will do it.

select syscolumns.name,systypes.name,syscolumns.length from sysobjects 
inner join syscolumns on syscolumns.id = sysobjects.id 
inner join systypes on systypes.type = syscolumns.type 
where sysobjects.type  = 'U' 
and sysobjects.name ='yourtablename' 





-----Original Message-----
From: Cameron Childress
To: SQL
Sent: 08/02/2005 16:59
Subject: Re: returning datatypes from table using CF5

For SQL Server, you're going to want to look into sysobjects.  Access
is similar, but I can't remember exactly the table names.  Google for
"system tables" and you should get what you need.

-Cameron


On Mon, 7 Feb 2005 15:28:16 -0800 (PST), William Kossack
<[EMAIL PROTECTED]> wrote:
> we are moving to sql server but some databases are
> still in access
> 
> --- Cameron Childress <[EMAIL PROTECTED]> wrote:
> 
> > Depending on the database platform, you should be
> > able to query the
> > system tables to get this information.  What
> > platform are you on?
> >
> > -Cameron
> >
> > On Mon, 07 Feb 2005 16:58:18 -0400, william kossack
> > <[EMAIL PROTECTED]> wrote:
> > > I'm using CF5
> > >
> > > I need to be able to query a database table and
> > return the data types.
> > >
> > > I'm currently using queryname.columnlist to get a
> > list of the field names but I can't seem to get the
> > data types
> > >
> > >
> >
> >
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase Homesite Plus with Dreamweaver from House of Fusion, a Macromedia 
Authorized Affiliate and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=55

Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2112
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to