Mark,

The column names aren't defined currently. They are values in a table.

Dave


-----Original Message-----
From: Mark Richards [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 12, 2003 10:43 AM
To: CF-Talk
Subject: Re: OT:Advanced SQL Query


Dave,

You can retrieve the names of the columns by using the system tables.  I

assume you know the name of the table you are working with so the
following 
query should work:

SELECT  T0.name
FROM    syscolumns AS T0
        INNER JOIN sysobjects AS T1 ON
                T0.id   = T1.id
WHERE   T1.name = @tableName


Hope this helps!


Mark Richards
Application Developer
BioLab, Inc.


>From: "Dave Sueltenfuss" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: OT:Advanced SQL Query
>Date: Tue, 12 Aug 2003 10:06:12 -0400
>
>Good Morning,
>
>Sorry for the off-topic post
>
>I have a complex SQL statement that I am trying to write, and need a 
>little help. I have a table with three field, employee, action, and 
>value. I want to make a crosstab view, with the value of action being 
>the column names, and the values of value being the column data
>
>I know I can do this by hard coding the action values into a view, but 
>I am wondering is there is a way to dynamically create this, so I do 
>not need to modify it when additional actions are added to the process
>
>Any help is appreciated
>
>Thanks in advance
>
>Dave Sueltenfuss
>Application Developer
>Certified ColdFusion MX Developer
>Arch Wireless
>Phone: 508-870-6711
>Fax: 508-870-8011
>Email: [EMAIL PROTECTED]
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to