How much of a performance hit is this?  It's probably quicker doing it is
sql, right?  The piece of code I'm working on isn't going to be used
regularly, so I could see this cf snippet being a good option.  I'll
implement this and see if it truly affects performance.  Thanks, everyone,
for the help.  A GREAT response on this list.

-----Original Message-----
From: Jerry Johnson [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 20, 2002 11:52 AM
To: CF-Talk
Subject: RE: OT (SQL): Add column to query?


And just to make his option set complete, he could add a column to the query
AFTER it is returned to CF.

<cfset myColFiller=arrayNew(1)>
<cfset temp=ArraySet(myColFiller, 1, myQuery.recordCount, '24')>

<cfset temp=QueryAddColumn(myQuery, 'myCol', myColFiller)>

Again, this is not the best way.

Jerry Johnson



>>> [EMAIL PROTECTED] 05/20/02 11:29AM >>>
I think he doesn't want to alter the table... just the results.
And it's not during the query, it's after you get the results... right?
Otherwise you could query like
select col1, col2, col3, '24' as myCol from mytable


-----Original Message-----
From: Andre Turrettini [mailto:[EMAIL PROTECTED]] 
Sent: Monday, May 20, 2002 11:12 AM
To: CF-Talk
Subject: RE: OT (SQL): Add column to query?


do a google search on "alter table"

-----Original Message-----
From: Ryan Pieszak [mailto:[EMAIL PROTECTED]] 
Sent: Monday, May 20, 2002 9:13 AM
To: CF-Talk
Subject: OT (SQL): Add column to query?


I know this is OT, but I've seen some SQL on this list lately, so I figured
I ask:
Let's say I have this query: 

Col1    Col2    Col3 
1       a       10 
2       b       11 
3       c       12 
4       d       13 
5       e       14 
6       f       15 

But I'd like to add a column to this query later in the process, so I'd have
this: 

Col1    Col2    Col3    myCol   
1       a       10      24 
2       b       11      24 
3       c       12      24 
4       d       13      24 
5       e       14      24 
6       f       15      24 

Is there a queryAppend, or something I can use to add a column to a query in
MSSQL? If it makes a difference, every value in the added column will be the
same. Thanks for any help. Ryan




______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to