RE: SQL Server and Nulls

2015-04-17 Thread DURETTE, STEVEN J
Dbfield= Steve -Original Message- From: Robert Harrison [mailto:rharri...@aimg.com] Sent: Friday, April 17, 2015 3:58 PM To: cf-talk Subject: SQL Server and Nulls In an update query, to a tinyint field which allows nulls, I have the update dbfield=#mydatefield# If mydatefield has no

Re: SQL Server and Nulls

2015-04-17 Thread John M Bliss
dbfield = On Fri, Apr 17, 2015 at 3:58 PM, Robert Harrison wrote: > > In an update query, to a tinyint field which allows nulls, I have the > update > > dbfield=#mydatefield# > > If mydatefield has no value, sql is throwing an error. The field allows > nulls. I've never had to say if "" then N

RE: SQL Global String Replace

2014-03-06 Thread Robert Harrison
> you could just used a stored procedure which will save it directly to the > database, and then execute it from CF That never even crossed my mind. Good idea. Thanks. Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct   125 Kennedy D

Re: SQL Global String Replace

2014-03-06 Thread Russ Michaels
you could just used a stored procedure which will save it directly to the database, and then execute it from CF On Thu, Mar 6, 2014 at 9:05 PM, Robert Harrison wrote: > > Thanks everyone for the suggestions. I've tested the one at this link: > http://www.mssqltips.com/sqlservertip/1555/sql-se

RE: SQL Global String Replace

2014-03-06 Thread Robert Harrison
Thanks everyone for the suggestions. I've tested the one at this link: http://www.mssqltips.com/sqlservertip/1555/sql-server-find-and-replace-values-in-all-tables-and-all-text-columns/ and it works perfectly. I mentioned previously that I was hoping to run it in CF, and that was partially b

RE: SQL Global String Replace

2014-03-04 Thread Jeff Garza
7; FETCH NEXT FROM userColumns INTO @columnName END CLOSE userColumns DEALLOCATE userColumns PRINT '1=1' PRINT 'GO' PRINT ' ' FETCH NEXT FROM userTables INTO @tableName, @columnName END CLOS

RE: SQL Global String Replace

2014-03-04 Thread Robert Harrison
Actually, that's the kind of operation that you'd not want to perform in CF (or PHP or any other database client). Unless you truly need all that data within a CF page for some other reason, you shouldn't be sending it all back and forth between DBMS and CF. ... I'm going to do this locally,

RE: SQL Global String Replace

2014-03-04 Thread Ben Forta
Actually, that's the kind of operation that you'd not want to perform in CF (or PHP or any other database client). Unless you truly need all that data within a CF page for some other reason, you shouldn't be sending it all back and forth between DBMS and CF. --- Ben (Sent from my newest Android

RE: SQL Global String Replace

2014-03-04 Thread Robert Harrison
Yes, I do mean like that, but I was really hoping someone had it already written up in CF with a tested procedure they would be willing to share. I was able to find several downloads for PHP, but nothing for CF. Thanks Robert Harrison Director of Interactive Services Austin & Williams Adver

RE: SQL Global String Replace

2014-03-04 Thread Jeff Garza
Take a look at the sys.tables and sys.columns tables in your SQL database. You should be able to write a couple of cursors to loop over each and just print out the SQL to run separately (or you can get fancy and generate the SQL statement and run it via EXEC sp_executeSQL functions). I don't have

Re: SQL Global String Replace

2014-03-04 Thread Russ Michaels
you mean like this http://www.mssqltips.com/sqlservertip/1555/sql-server-find-and-replace-values-in-all-tables-and-all-text-columns/ On Tue, Mar 4, 2014 at 1:55 PM, Robert Harrison wrote: > > Does anyone have an update program that can update a text string in all > tables/rows/columns of an MS

Re: sql injection attempt

2013-01-24 Thread Ian Chapman
Yes indeed. We had some attempts to injection attack via a fake useragent variable in the CGI scope, as we were logging visiting useragents in a database table. Luckily they were not able to execute any code thanks to tight SQL permissions, but the code they were trying to execute was written

Re: sql injection attempt

2013-01-23 Thread Pete Freitag
On Wed, Jan 23, 2013 at 12:57 PM, Rob Voyle wrote: > > Hi Greg > As I continue to update my security processes, I'm curious > Was this injection attempt at the url or at a form input. > Keep in mind that vulnerabilites can come from any input that the attacker can manipulate, eg form, url, cgi,

Re: sql injection attempt

2013-01-23 Thread Greg Morphis
It was attempted via the URL On Wed, Jan 23, 2013 at 11:57 AM, Rob Voyle wrote: > > Hi Greg > As I continue to update my security processes, I'm curious > Was this injection attempt at the url or at a form input. > > Thanks > Rob > > On 22 Jan 2013 at 11:12, Greg Morphis wrote: > > > > > I saw

Re: sql injection attempt

2013-01-23 Thread Rob Voyle
Hi Greg As I continue to update my security processes, I'm curious Was this injection attempt at the url or at a form input. Thanks Rob On 22 Jan 2013 at 11:12, Greg Morphis wrote: > > I saw some request errors but what were they trying to do? > This is what the onRequest error email showed >

Re: sql injection attempt

2013-01-22 Thread Justin Scott
> Ah so they were just checking to see if they could get something to work > before possibly trying anything real. That's a pretty standard approach. If they can get the response to delay then they can mark that URL as a potential entry point to come back and explore more later. -Justin ~

Re: sql injection attempt

2013-01-22 Thread Greg Morphis
Ah so they were just checking to see if they could get something to work before possibly trying anything real. Thanks! On Tue, Jan 22, 2013 at 11:15 AM, John M Bliss wrote: > > That's hex for, "?WAITFOR DELAY '00:00:15'" > > On Tue, Jan 22, 2013 at 11:12 AM, Greg Morphis wrote: > > > 0x57414

Re: sql injection attempt

2013-01-22 Thread John M Bliss
That's hex for, "?WAITFOR DELAY '00:00:15'" On Tue, Jan 22, 2013 at 11:12 AM, Greg Morphis wrote: > 0x57414954464F522044454C4159202730303A30303A313527 > -- John Bliss - http://about.me/jbliss ~| Order the Adobe Coldfusio

Re: SQL Question, incrementing values

2012-12-13 Thread Scott Stewart
DOH!! end of the day, yeah... cc.cc_type_id isn't part of a group by or aggregate function.. and I need those end values as part of the returned record set On 12/13/2012 4:49 PM, John M Bliss wrote: > This gives you the error...? > > CASE > WHEN cc.cc_type_ID = 1 THEN @careCB + 1 > WHEN cc.cc_ty

Re: SQL Question, incrementing values

2012-12-13 Thread Scott Stewart
Except I need those values individually as part of the return.. On 12/13/2012 4:49 PM, John M Bliss wrote: > This gives you the error...? > > CASE > WHEN cc.cc_type_ID = 1 THEN @careCB + 1 > WHEN cc.cc_type_ID = 2 THEN @careFBC + 1 > WHEN cc.cc_type_ID = 3 THEN @careSBC + 1 > WHEN cc.cc_type_ID =

Re: SQL Question, incrementing values

2012-12-13 Thread John M Bliss
This gives you the error...? CASE WHEN cc.cc_type_ID = 1 THEN @careCB + 1 WHEN cc.cc_type_ID = 2 THEN @careFBC + 1 WHEN cc.cc_type_ID = 3 THEN @careSBC + 1 WHEN cc.cc_type_ID = 4 THEN @careVACC + 1 WHEN cc.cc_type_ID = 5 THEN @careOFCC + 1 ELSE 0 END AS myvar On Thu, Dec 13, 2012 at 3:45 PM, Sco

Re: SQL Express and CF

2012-11-16 Thread Donnie Bachan (Gmail)
You'll need to purchase the developer edition for SSIS. It's not free but has full standard level features and is pretty affordable $50 US at NewEgg http://www.newegg.com/Product/Product.aspx?Item=N82E16832416455&Tpk=sql%20server%20developer Best Regards, Donnie Bachan "Nitendo Vinces - By Striv

Re: SQL Express and CF

2012-11-16 Thread Carl Von Stetten
I spoke too soon. The installer with tools provides limited replication support and SSMS, but not SSIS. -Carl V. On 11/15/2012 4:30 PM, Carl Von Stetten wrote: > Starting with SQL Server Express 2008 R2 (and maybe some prior > versions), you can download an installer that includes the SSMS too

Re: SQL Express and CF

2012-11-15 Thread Carl Von Stetten
Starting with SQL Server Express 2008 R2 (and maybe some prior versions), you can download an installer that includes the SSMS tools, which I think includes SSIS as well. -Carl V. On 11/15/2012 1:32 PM, Mike Kear wrote: > the things cut out of the express version are the kinds of things we use >

Re: SQL Express and CF

2012-11-15 Thread Russ Michaels
When I last used that trick the management studio never stopped working, only sql server, so unlrss they have changed that, its a free way to get more features out of express edition. Regards Russ Michaels www.michaels.me.uk www.cfmldeveloper.com - Free CFML hosting for developers www.cfsearch.co

Re: SQL Express and CF

2012-11-15 Thread Gerald Guido
> > Or downliad the full trial version with tools and get studio from there > instead. Yeah, what Russ said. I think the trial version is good for 6 months. IIRC you can also get the MSSQL developer edition for $40-$50. It is the equivalent of the Enterprise version. Not sure if the Licencing

Re: SQL Express and CF

2012-11-15 Thread Russ Michaels
You do get ssis and backups its just not in the sql management studio so you have to script it. Or downliad the full trial version with tools and get studio from there instead. Regards Russ Michaels www.michaels.me.uk www.cfmldeveloper.com - Free CFML hosting for developers www.cfsearch.com - CF

Re: SQL Express and CF

2012-11-15 Thread Justin Scott
> Oh, and I don't think you can run scheduled backups either. Which > is an issue when using it in production. We use Tomahawk Backup on some of our web servers to back up the website code and images to both local and off-site storage. Tomahawk (and many other backup utilities) will interface wi

Re: SQL Express and CF

2012-11-15 Thread .jonah
Oh, and I don't think you can run scheduled backups either. Which is an issue when using it in production. On 11/15/12 1:32 PM, Mike Kear wrote: > the things cut out of the express version are the kinds of things we use > coldfusion for anyway. I havent found any issues at all in connecting >

Re: SQL Express and CF

2012-11-15 Thread Mike Kear
the things cut out of the express version are the kinds of things we use coldfusion for anyway. I havent found any issues at all in connecting SQLexpress versions and Coldfusion. The only issues I've had are to do with things like the lack of SSIS which makes things like moving data to online mo

Re: SQL Express and CF

2012-11-15 Thread Pete Ruckelshaus
Works just like the full version, and it's what I use on my VPS. On Thu, Nov 15, 2012 at 5:23 AM, Kevin Parker wrote: > > Are there any issues using Express versions of SQL Server for development? > > > > Thank you > > > > > > ++ > > Kevin Parker > > > > M: 0418 815 527 > > > >

Re: SQL Express and CF

2012-11-15 Thread .jonah
Works fine for me. (I think it has a 2GB database size limit.) It also doesn't support DTS and some other nice management functionality, but most of the features of Enterprise Manager are there. On 11/15/12 2:23 AM, Kevin Parker wrote: > Are there any issues using Express versions of SQL Server

Re: SQL Injection

2012-05-24 Thread JR
This is possibly from XRumer. It is link building/forum spamming software. On Thu, May 24, 2012 at 5:30 AM, Kevin Parker wrote: > > One of my sites that has some anti-injection script reported this today - > does anyone know what this clown was trying to do. Thank you!! > > URL: > > /news_detail

Re: SQL need to return data even if specific where statement isnt matched

2011-09-27 Thread Michael Grant
Switch your query around and join the answers to the questions, instead of the questions to the answers. Hopefully that makes sense. On Mon, Sep 26, 2011 at 11:43 AM, Adam Bourg wrote: > > 've built an extension to a employment application where we can easily add > new questions to the form. I

Re: SQL grrr

2011-09-26 Thread Leigh
> If you mean only ID's linked to all three (3) values?  Something like this Duh. Just noticed I left off the GROUP BY...   ... SELECT  ID, COUNT(Value) AS MatchCount FROM TableName WHERE   ID IN ( ) GROUP BY ID  HAVING  COUNT(Value) = http://www.amazon.com/Adobe-Coldfusion-Anthology/

Re: SQL grrr

2011-09-26 Thread Richard White
thanks, works perfect! > Hi, > > i know this is probably a simple answer and i probably drunk too much > coffee! > > given the following sql data: > > ID value > > 1 A > 1 B > 1 C > 2 A > 2 B > 3 A > 3 B > 3 C > > i need to run a query that says return me the ids th

Re: SQL grrr

2011-09-26 Thread Carl Von Stetten
Or change the first line to: select distinct t.ID (again assumes SQL Server) Carl On 9/26/2011 10:44 AM, Josh Nathanson wrote: > Yup, I think Carl's is the best, though you'd probably want to throw a GROUP > BY in there so you don't get multiple rows for the same ID. > > -- Josh > > On Mon, Sep

Re: SQL grrr

2011-09-26 Thread Josh Nathanson
Yup, I think Carl's is the best, though you'd probably want to throw a GROUP BY in there so you don't get multiple rows for the same ID. -- Josh On Mon, Sep 26, 2011 at 10:41 AM, Carl Von Stetten wrote: > > Richard, > > I think this will work (untested, assumes SQL Server): > > select t.ID > fr

Re: SQL grrr

2011-09-26 Thread Steve Milburn
I'm sure there is a much more efficient way of doing this, but this would work: SELECT distinct ID from table where id in (select ID from table where val = 'A' and id in (select id from table where val = 'B' and ID in (select id from table where val = 'C'))) On Mon, Sep 26, 2011 at 1:18 PM, Ric

Re: SQL grrr

2011-09-26 Thread Carl Von Stetten
Richard, I think this will work (untested, assumes SQL Server): select t.ID from mytable t inner join mytable a on t.id = a.id and a.value = 'A' inner join mytable b on t.id = b.id and b.value = 'B' inner join mytable c on t.id = c.id and c.value = 'C' HTH, Carl ~~~

Re: SQL grrr

2011-09-26 Thread Leigh
> ids that are linked to values A and B and C. If you mean only ID's linked to all three (3) values?  Something like this ... SELECT  ID, COUNT(Value) AS MatchCount FROM TableName WHERE   ID IN ( ) HAVING  COUNT(Value) = http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?t

Re: SQL grrr

2011-09-26 Thread Matt Quackenbush
Something like... SELECT ID FROM MyTable WHERE value IN () ; ?? On Mon, Sep 26, 2011 at 12:18 PM, Richard White wrote: > > Hi, > > i know this is probably a simple answer and i probably drunk too much > coffee! > > given the following sql data: > > ID

Re: SQL Query Problem

2011-06-21 Thread Michael Grant
t; > Jenny > > >>-Original Message- > >>From: Michael Grant [mailto:mgr...@modus.bz] > >>Sent: 21 June 2011 23:27 > >>To: cf-talk > >>Subject: Re: SQL Query Problem > >> > >> > >> > >>Right, but if tha

RE: SQL Query Problem

2011-06-21 Thread Jenny Gavin-Wear
Hi Michael, The (very old) web site is about to be completely redeveloped, so I'm really not too worried. Appreciate your concern though :) Jenny >>-Original Message- >>From: Michael Grant [mailto:mgr...@modus.bz] >>Sent: 21 June 2011 23:27 >>To: cf-

Re: SQL Query Problem

2011-06-21 Thread Michael Grant
Tue, Jun 21, 2011 at 5:15 PM, Jenny Gavin-Wear < jenn...@fasttrackonline.co.uk> wrote: > > I was waiting for a comment on that. > > It's a very small table :) > > >>-Original Message- > >>From: Michael Grant [mailto:mgr...@modus.bz]

RE: SQL Query Problem

2011-06-21 Thread Jenny Gavin-Wear
I was waiting for a comment on that. It's a very small table :) >>-Original Message- >>From: Michael Grant [mailto:mgr...@modus.bz] >>Sent: 21 June 2011 19:46 >>To: cf-talk >>Subject: Re: SQL Query Problem >> >> >

Re: SQL Query Problem

2011-06-21 Thread John M Bliss
She didn't provide column names... On Tue, Jun 21, 2011 at 1:45 PM, Michael Grant wrote: > > Off topic, but the "Select *" made me shudder. > > > On Tue, Jun 21, 2011 at 2:25 PM, Jenny Gavin-Wear < > jenn...@fasttrackonline.co.uk> wrote: > > > > > Looks like I went with the vote, lol > > > > Ma

Re: SQL Query Problem

2011-06-21 Thread Ras Tafari
+420 On Tue, Jun 21, 2011 at 2:45 PM, Michael Grant wrote: > > Off topic, but the "Select *" made me shudder. > > > On Tue, Jun 21, 2011 at 2:25 PM, Jenny Gavin-Wear < > jenn...@fasttrackonline.co.uk> wrote: > >> >> Looks like I went with the vote, lol >> >> Many thanks for all replies, and fast

Re: SQL Query Problem

2011-06-21 Thread Michael Grant
Off topic, but the "Select *" made me shudder. On Tue, Jun 21, 2011 at 2:25 PM, Jenny Gavin-Wear < jenn...@fasttrackonline.co.uk> wrote: > > Looks like I went with the vote, lol > > Many thanks for all replies, and fast too :) > > Some payments from Paypal transactions, some manually entered on

RE: SQL Query Problem

2011-06-21 Thread Jenny Gavin-Wear
Looks like I went with the vote, lol Many thanks for all replies, and fast too :) Some payments from Paypal transactions, some manually entered on profiles. Legacy code :/ Jenny select * from tbl_members where (datepart(m,paid) = #session.month# and datepart(,paid) = #session.year# AND mem

Re: SQL Query Problem

2011-06-21 Thread John M Bliss
That looks familiar! :-) On Tue, Jun 21, 2011 at 1:09 PM, Stephane Vantroyen wrote: > > I would do it this way : > > select b.* > from b > where b.id not in (select a.id from a) > > > > >How about: > > > >select b.* > >from b > >left outer join a on b.id = a.id > >where a.id is null > > > >Car

Re: SQL Query Problem

2011-06-21 Thread Stephane Vantroyen
I would do it this way : select b.* from b where b.id not in (select a.id from a) >How about: > >select b.* >from b >left outer join a on b.id = a.id >where a.id is null > >Carl > >On 6/21/2011 10:37 AM, Jenny Gavin-Wear wrote: >>

Re: SQL Query Problem

2011-06-21 Thread Carl Von Stetten
How about: select b.* from b left outer join a on b.id = a.id where a.id is null Carl On 6/21/2011 10:37 AM, Jenny Gavin-Wear wrote: > Two tables each containing a shared primary key ID. > > I am trying to create a query that lists records from table B that are not > in table A. > > Many thanks

RE: SQL Query Problem

2011-06-21 Thread Jenny Gavin-Wear
Thanks John and Greg :) >>-Original Message- >>From: Greg Morphis [mailto:gmorp...@gmail.com] >>Sent: 21 June 2011 18:45 >>To: cf-talk >>Subject: Re: SQL Query Problem >> >> >> >>if your tables are large, you'll probably see

Re: SQL Query Problem

2011-06-21 Thread Greg Morphis
if your tables are large, you'll probably see a better performance from select id from TableA a where not exists (select 1 from TableB b where a.id = b.id) On Tue, Jun 21, 2011 at 12:41 PM, John M Bliss wrote: > > select * from b where id not in (select id from a) > > On Tue, Jun 21, 2011 at 12

Re: SQL Query Problem

2011-06-21 Thread John M Bliss
select * from b where id not in (select id from a) On Tue, Jun 21, 2011 at 12:37 PM, Jenny Gavin-Wear < jenn...@fasttrackonline.co.uk> wrote: > > Two tables each containing a shared primary key ID. > > I am trying to create a query that lists records from table B that are not > in table A. > > M

Re: SQL Quandary

2011-05-23 Thread Michael Grant
Simple and elegant. On Sun, May 22, 2011 at 10:11 PM, James Holmes wrote: > > It can be. > > Taking your last example: > > IF (SELECT checkProjected FROM tbl_Params WHERE siteID = 1) = 1 > select projected from tbl_stockItems where projected > 10 > else > select projected from tbl_stockItems whe

RE: SQL Quandary

2011-05-23 Thread Jenny Gavin-Wear
That's perfect, thank you James! >>-Original Message- >>From: James Holmes [mailto:james.hol...@gmail.com] >>Sent: 23 May 2011 03:12 >>To: cf-talk >>Subject: Re: SQL Quandary >> >> >> >>It can be. >> >>Taking your la

Re: SQL Quandary

2011-05-22 Thread James Holmes
It can be. Taking your last example: IF (SELECT checkProjected FROM tbl_Params WHERE siteID = 1) = 1 select projected from tbl_stockItems where projected > 10 else select projected from tbl_stockItems where projected <10 This can be written as: select projected from tbl_stockItems where ( (

RE: SQL Quandary

2011-05-22 Thread Jenny Gavin-Wear
011 01:47 >>To: cf-talk >>Subject: Re: SQL Quandary >> >> >> >>Why not just add the subquery in as part of the where clause for each >>type of record you want? >> >>On Monday, 23 May 2011, Jenny Gavin-Wear >> wrote: >>> >>>

RE: SQL Quandary

2011-05-22 Thread Jenny Gavin-Wear
Sure, I use QofQ a lot. What I wanted from this solution was to reduce the number of records being returned by the query before it even got to CF. >>-Original Message- >>From: Russ Michaels [mailto:r...@michaels.me.uk] >>Sent: 23 May 2011 01:22 >>To: cf-talk >

Re: SQL Quandary

2011-05-22 Thread James Holmes
Why not just add the subquery in as part of the where clause for each type of record you want? On Monday, 23 May 2011, Jenny Gavin-Wear wrote: > > Thanks Russ, I agree, I can't see a way around it using CASE or JOINS. > -- -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ ~

Re: SQL Quandary

2011-05-22 Thread Russ Michaels
e if it actually runs faster then > using > Jenny > > > >>-Original Message- > >>From: Russ Michaels [mailto:r...@michaels.me.uk] > >>Sent: 23 May 2011 00:14 > >>To: cf-talk > >>Subject: Re: SQL Quandary > >> > >> &g

RE: SQL Quandary

2011-05-22 Thread Jenny Gavin-Wear
ally runs faster then using >-Original Message- >>From: Russ Michaels [mailto:r...@michaels.me.uk] >>Sent: 23 May 2011 00:14 >>To: cf-talk >>Subject: Re: SQL Quandary >> >> >> >>if there is no relationship between tableC and the other tables

Re: SQL Quandary

2011-05-22 Thread Russ Michaels
happen in SQL, if > possible. > > Jenny > > >>-Original Message- > >>From: Russ Michaels [mailto:r...@michaels.me.uk] > >>Sent: 22 May 2011 18:20 > >>To: cf-talk > >>Subject: Re: SQL Quandary > >> > >> > >> >

RE: SQL Quandary

2011-05-22 Thread Jenny Gavin-Wear
. Jenny >>-Original Message- >>From: Russ Michaels [mailto:r...@michaels.me.uk] >>Sent: 22 May 2011 18:20 >>To: cf-talk >>Subject: Re: SQL Quandary >> >> >> >>It would be easier to refer to this 3rd table if you supply the >>ta

RE: SQL Quandary

2011-05-22 Thread Jenny Gavin-Wear
can't get the syntax. Jenny >>-Original Message- >>From: Pete Jordan [mailto:houseoffus...@skydancer.org.uk] >>Sent: 22 May 2011 19:00 >>To: cf-talk >>Subject: Re: SQL Quandary >> >> >> >>What Russ wrote regarding your paramet

Re: SQL Quandary

2011-05-22 Thread Pete Jordan
What Russ wrote regarding your parameters table. I've not got an SQL server box booted up to check, but the equivalent of the following sort of thing works fine in MySQL: SELECT dbo.tbl_stock.stockID, dbo.tbl_stockItems.stockItemID, dbo.tbl_stockItems.projected FROM dbo.tbl_stock INNER JOIN dbo

Re: SQL Quandary

2011-05-22 Thread Russ Michaels
It would be easier to refer to this 3rd table if you supply the table.columnname so we know what were talking about. what is the relationship between this table and the other tables in the query, and from where does the value come that you want to compare it with. On Sun, May 22, 2011 at 4:46 P

Re: SQL selecting distinct items by date?

2011-02-14 Thread Brian Cain
Sorry I am a little late in the reply on this one, but did you try using the MAX function. SELECT DISTINCT TOP 5 pivot.CategoryID, Category.Name, MAX(Item.DateAdded) FROM Category INNER JOIN pivot ON Category.CategoryID = pivot.CategoryID INNER JOIN Item ON pivot.ItemID = Item.ItemID GROUP BY pi

Re: SQL selecting distinct items by date?

2011-02-14 Thread Aaron Rouse
nk it'll do what's > needed. The results can be looped over to get more detail which means > subqueries, but it functions. Combining TOP and DISTINCT with GROUP/ORDER > remains somewhat uncertain... > > > -Original Message- > From: John M Bliss [mailto:bliss.j

RE: SQL selecting distinct items by date?

2011-02-13 Thread wabba
e looped over to get more detail which means subqueries, but it functions. Combining TOP and DISTINCT with GROUP/ORDER remains somewhat uncertain... -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Sunday, February 13, 2011 10:55 AM To: cf-talk Subject: Re: SQL se

Re: SQL selecting distinct items by date?

2011-02-13 Thread John M Bliss
SELECT TOP 5 DISTINCT pivot.CategoryID, Category.Name, YEAR(Item.DateAdded) AS theyear, MONTH(Item.DateAdded) AS themonth, DAY(Item.DateAdded) AS theday On Sun, Feb 13, 2011 at 12:51 PM, wabba wrote: > > More on SQL-topic than CF (MS SQL), but hopefully is an easy one. I have > items with a da

Re: SQL query question

2011-02-02 Thread Sean Henderson
With ColdFusion 9, we ended up replacing all the wildcard selects with actual column names, among other fortifications. We did not experience this issue on 6.1. ~| Order the Adobe Coldfusion Anthology now! http://www.amaz

RE: SQL query question

2011-02-01 Thread Debbie Morris
ates for the evening, so I'll tackle this again in the morning. Thanks for the help! Debbie -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Tuesday, February 01, 2011 5:41 PM To: cf-talk Subject: Re: SQL query question > > The evil of using * in SELECT c

Re: SQL query question

2011-02-01 Thread Michael Grant
> > The evil of using * in SELECT clauses. > I'm with Ian on this 100%. Often times developers think that using * will be faster, and easier and allow more flexibility. However that couldn't be further from the truth as you are seeing now. Take Ian's advice and define each column you want from yo

Re: SQL query question

2011-02-01 Thread Ian Skinner
On 2/1/2011 2:21 PM, Charlie Stell wrote: > I assume this is something on CF's side - > as restarting the CF service also fixes it. Not ColdFusion itself, but the database drivers used by ColdFusion and the cached (pooled) data source settings. Changing the Datasource to not used pooled setting

Re: SQL query question

2011-02-01 Thread Ian Skinner
On 2/1/2011 1:23 PM, Debbie Morris wrote: > What am I overlooking? The evil of using * in SELECT clauses. When that is done, database drivers are know to cache the columns and datatypes of the SQL queries. Then somebody comes along and changes the database structure, like you adding a field.

Re: SQL query question

2011-02-01 Thread Charlie Stell
This might be an issue I've had to deal with before. Do something to change the "fingerprint" (no idea what the correct term would be) of the query - or restart cf. By change the "fingerprint", it could be something as simple ad swapping p.* and pt.* (swapping as in their ordinal position in the

Re: SQL Join Woes

2011-02-01 Thread Aaron M Renfroe
Thank you! I will research the UNION Clause. You have been a great help! On Tue, Feb 1, 2011 at 3:13 PM, Ian Skinner wrote: > > On 2/1/2011 11:35 AM, Aaron M Renfroe wrote: > > On another note, the > > query that brought back 98 results may have been working right, i found > > another 78 record

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 11:35 AM, Aaron M Renfroe wrote: > On another note, the > query that brought back 98 results may have been working right, i found > another 78 records in another table for race car radiators, i'm almost > guessing that the last few are in another table that would make the total > 200 r

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 11:35 AM, Aaron M Renfroe wrote: > But i'm now getting an error that the part_number field > is ambiguous. Ugh That just means that the field is in both (multiple) tables and the database wants you to tell it which table you want to use to get the value for this column to use in

Re: SQL Join Woes

2011-02-01 Thread Aaron M Renfroe
I guess it could be both. While some part numbers can fit multiple years, makes, and models of a vehicle others just fit one. The top 200 are our best selling radiators. In theory, i want to hit the master table, pull out all the information on the radiator based on the part number being supplied

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 10:22 AM, Aaron Renfroe wrote: > Hello Ian and thank you! > > But my query was still running wrong, correct? Not necessarily, maybe your data is wrong. You may need to provide some more description on what data is in each of these tables and how you are trying to utilize it before

Re: SQL Join Woes

2011-02-01 Thread Aaron Renfroe
Hello Ian and thank you! I have tried both the left and right joins, the RIGHT join brought back the 15k results again, the LEFT join was bringing back so many that i killed the browser before it hurt something :) JOINS: SELECT * FROM GriffinDataRevised LEFT OUTER JOIN Top200 ON GriffinDa

Re: SQL Join Woes

2011-02-01 Thread Greg Morphis
a standard join looks like this.. select foo from a join b on a.id = b.id So yours would look something like SELECT PartNumber FROM GriffinDataRevised d JOIN Top200 t on d.partnumber = t.part_number You're not technically doing a join, you're doing a sub query. On Tue, Feb 1, 2011 at 11:41 AM

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 9:41 AM, Aaron Renfroe wrote: > Hello All! > > SELECT DISTINCT PartNumber FROM GriffinDataRevised > INNER JOIN Top200 ON GriffinDataRevised.PartNumber = Top200.Part_Number > WHERE Top200.part_number = GriffinDataRevised.PartNumber INNER JOIN will enforce a filter tha

Re: SQL 2008 standard vs. web

2011-01-05 Thread Mike Chabot
A primary question to answer is whether you need the business intelligence tools that are part of the SQL Server platform, notably SSIS, which is not available in the Web edition. I use SSIS and SSRS extensively, so I have to use at least the Standard edition. You can always start with a cheap ver

Re: SQL 2008 standard vs. web

2011-01-05 Thread Dave Watts
> There are a few different versions of SQL 2008. One of them is billed > as SQL server web which is focused on being the backend for a data > driven website. Has anyone used this and have they had any problems? > Any real differences between this and SQL 2008 standard? I'm inclined > to go with t

RE: SQL 2008 standard vs. web

2011-01-05 Thread Justin Scott
> There are a few different versions of SQL 2008. One of them > is billed as SQL server web which is focused on being the > backend for a data driven website. Has anyone used this and > have they had any problems? The engine itself should be essentially the same between editions, the main differe

RE: SQL 2008 standard vs. web

2011-01-05 Thread Russ Michaels
They're close, but not quite the same. The primary difference is the licensing . The other differences are around mirroring (web can only serve as a witness), publishing (web can only subscribe), and perf (web does not come with SQL Profiler). There are more differences when you get out of the SQ

Re: SQL Azure and Coldfusion 9

2010-11-30 Thread Sean Henderson
Rather that CF9 and CFQUERY handle it better To my mind, if CFQUERY does not error out, then the queryname, recordcount and column list in all cases should be set, regardless of driver or target database. For those of us with sprawling apps to maintain (1,000s of .cfm files) and where a global

RE: SQL Azure and Coldfusion 9

2010-11-30 Thread DURETTE, STEVEN J (ATTASIAIT)
So use isDefined(Variables.queryname) first. -Original Message- From: Sean Henderson [mailto:shender...@followup.net] Sent: Tuesday, November 30, 2010 4:14 PM To: cf-talk Subject: Re: SQL Azure and Coldfusion 9 >This is actually incredibly easy to deal with this scenario, you j

Re: SQL Azure and Coldfusion 9

2010-11-30 Thread Sean Henderson
>This is actually incredibly easy to deal with this scenario, you just have >to check for the existence of the query variable first. >You would normally check the recordcount > 0 anyway so you don't output >nothing, so it really isn't any more work. That would be true except when recordcount isn'

RE: SQL Azure and Coldfusion 9

2010-11-26 Thread Russ Michaels
Sean, This is actually incredibly easy to deal with this scenario, you just have to check for the existence of the query variable first. You would normally check the recordcount > 0 anyway so you don't output nothing, so it really isn't any more work. Russ -Original Message- From: Sean

RE: SQL 139 transaction error

2010-10-15 Thread cfcom
cant resolve Any thoughts would be appreciated -Original Message- From: Pete Freitag [mailto:p...@foundeo.com] Sent: 2010-10-15 13:23 To: cf-talk Subject: Re: SQL 139 transaction error Since MyISAM is a non-transactional storage engine, the error doesn't make too much sense to me

Re: SQL 139 transaction error

2010-10-15 Thread Pete Freitag
Since MyISAM is a non-transactional storage engine, the error doesn't make too much sense to me. Are you sure your migration from InnoDB was successful, and that you are infact using MyISAM and not InnoDB on this table? -- Pete Freitag http://foundeo.com/ - ColdFusion Consulting & Products http:/

Re: SQL Server Data Archival - my solution

2010-08-02 Thread Dan O'Keefe
I find this intriguing as well. Almost like a poor mans historical archive system. A generator for the triggers would be cool also based on Illidium PU-36 -- Dan O'Keefe On Fri, Jul 30, 2010 at 9:08 AM, Pete Ruckelshaus wrote: > > Feel free to pass on any enhancements or improveme

Re: SQL Server Data Archival - my solution

2010-07-30 Thread Pete Ruckelshaus
Feel free to pass on any enhancements or improvements! On Fri, Jul 30, 2010 at 11:02 AM, Robert Harrison < rob...@austin-williams.com> wrote: > > Very nice! Thanks for sharing that. Think I'll play with it a bit as well. > > > Robert B. Harrison > Director of Interactive Services > Austin & Will

RE: SQL Server Data Archival - my solution

2010-07-30 Thread Robert Harrison
Very nice! Thanks for sharing that. Think I'll play with it a bit as well. Robert B. Harrison Director of Interactive Services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't b

  1   2   3   4   5   6   7   8   9   10   >