Viewing 15 posts - 1,456 through 1,470 (of 1,957 total)
Of course, you might also want to only do this if fielda has changed...
add this to the where clause about fielda not being null :
... and not exists ( select...
February 24, 2011 at 5:50 pm
You need to translate your IFs into WHERE clauses...
update table1
set col1 = (select col1_source from inserted where hashFields = table1.unique_id)
where unique_id in (select hashFields from inserted where fielda is not...
February 24, 2011 at 5:47 pm
No, compatibility mode won't help you there.
For instance, aside from being able to use non-2000 data types, you can use CTEs, CROSS APPLY etc
And even behaviours that are supposed...
February 24, 2011 at 5:37 pm
Try this:
select Factor,min(PartNumber) as PartFrom,max(PartNumber) as PartTo
from Factors2Process
group BY Factor,stuff(PartNumber,7,5,'')
order by Factor,PartFrom
And by the way - there is no order by on the query in your cursor definition...you should...
February 24, 2011 at 5:00 pm
Lowell (2/18/2011)
what happened that made you start thinking something was flooding the server...after looking at...
February 18, 2011 at 7:51 am
Roy, you were spot on..I did a bit of research, found out about the idle timeout testing that C3P0 does and that led me to the configuration file that contained...
February 18, 2011 at 6:37 am
In this case, I am using CROSS APPLY just as a way of creating placeholders for the calculations.
It just makes the SELECT cleaner - but should not have any other...
February 18, 2011 at 6:30 am
Roy Ernest (2/18/2011)
I think it was created to test the connection pooling of C3P0 which is used by JDBC and nHybernate.
Great, thanks very much Roy, that has given me enough...
February 18, 2011 at 6:20 am
I think this is what I meant to write just now...
SELECT
sli.itemid ,
sli.title,
qtysold = SUM(qtys.qtysold),
change = SUM(qtys.qtysold - qtys.qtysoldprevious)
FROM
sale_line_item AS sli
JOIN
transactions AS trn
ON
trn.txid=sli.txid
CROSS APPLY
(
SELECT
qtysold...
February 17, 2011 at 4:47 pm
I agree with Craig, but also - why not try doing it all in one SELECT...?
edit: sorry my bad code removed
February 17, 2011 at 4:36 pm
GilaMonster (2/17/2011)
mister.magoo (2/17/2011)
I have noticed in the past that COUNT(*) does not always force a full count of all rows
It does. It reads the leaf level of the smallest index...
February 17, 2011 at 11:32 am
Ray K (2/17/2011)
Don't have one, only because I'm lazy. Haven't gotten around to it yet!
How about this one
February 17, 2011 at 7:33 am
Ok, I have had a quick check and can't find any noticable difference between them now, so maybe I just remembered something wrong....never mind - no harm done 😛
edit: checking...
February 17, 2011 at 5:16 am
I have noticed in the past that COUNT(*) does not always force a full count of all rows
I remember pushing the FIZZBUZZ problem to a trillion rows and used count...
February 17, 2011 at 4:29 am
What happens if you try this on both servers (post results back)?
set statistics io on;
set statistics time on;
go
set showplan_text on;
go
select count_big(all column_name)
from your_table
go
set showplan_text off;
go
set statistics time off;
set statistics io...
February 17, 2011 at 3:48 am
Viewing 15 posts - 1,456 through 1,470 (of 1,957 total)