Viewing 15 posts - 916 through 930 (of 1,825 total)
The join in the recursive element was reversed
with AMASST
as
(
Select 'Asset1' as Astno,
'Masterasset1' as mstno
union all
Select 'Asset2','Masterasset1'
union all
select 'Asset3','Asset2'
union all
select 'Asset4','Asset2'
)
,Sites (mstno, astno,rootasst)
AS
(
...
May 3, 2010 at 9:10 am
I think your confusion comes from not defining your anchor element(s) correctly
USE [cap100]
go
WITH Sites (mstno, astno,rootasst)
AS
(
-- Anchor member definition
SELECT mstno, astno ,astno...
May 3, 2010 at 8:31 am
All this sort of syntax
JDAReceipts.PartnerInvoiceNo = ISNULL(@PartnerInvoiceNo,JDAReceipts.PartnerInvoiceNo)
Will , pretty much guarantee table scans ,
try Gails page here http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/ for more info.
Edit--
Also you have a few scalar udfs...
May 3, 2010 at 8:06 am
Sorry , im a bit lost by your requirements can you post a simpler example ( I wont be offended if you feel its to simple and treat me like...
May 3, 2010 at 7:53 am
ankur003 (5/3/2010)
May 3, 2010 at 7:30 am
Here's one other side effect
http://sqlblogcasts.com/blogs/sqlandthelike/archive/2010/04/23/increasing-deadlocks-with-nolock.aspx
May 3, 2010 at 7:28 am
We can hate them both. Besides, they won't stop sending us beer. If you drink it, they'll keep exporting it.
You can always mark you share for my attention, ill happilly...
April 29, 2010 at 8:34 am
Well this would fall under the great caveat of "It depends".
The cross apply the kingston gave *could* perform better against a wider selection of rows.
What indexes do you have on...
April 19, 2010 at 12:09 pm
Sorry , i lost track of this...
Can you post some code that demonstrates the problem you are having?
April 19, 2010 at 8:16 am
One method would be
with cteTracks
as(
select Trip.id, TrackPoint.lat, TrackPoint.lon,ROW_NUMBER() over ( partition by Trip.id order by trackpoint.id) as RowN
from TrackPoint
join Track on Track.id = TrackPoint.trackID
...
April 16, 2010 at 11:28 pm
When i have to do a cursor i structure it like this , so this is not a issue
Declare ....
Open
While(0=0) begin
Fetch....
if(@@Fetch_status<>0) begin
...
April 15, 2010 at 1:49 am
Apologies for the size of this.....
Hmm , although i hear what you are saying comparing the Inline to the Scalar
Consider this
Drop FUNCTION dbo.pr_LunarPhaseITVF
go
CREATE FUNCTION dbo.pr_LunarPhaseITVF(@Year integer,@Month integer,@Day integer)
returns table
as
return(
...
April 9, 2010 at 4:13 am
Hmmm
Removing the Ip calculation and just setting it to zero , brings the run time crashing down to 600 - 700 ms..
April 9, 2010 at 2:40 am
Paul White NZ (4/8/2010)
Wow - what did you do??? :laugh:
Can't wait to see the code.
As crazy as it sounds, Im seeing the same as Lynn at the moment.
This is running...
April 9, 2010 at 2:29 am
As i said, you are only accounting a single row...
Try this...
CREATE TRIGGER [dbo].[TriggerTestforDelete]
ON [dbo].[TriggerTest]
FOR DELETE
AS
INSERT INTO ArchivePrice(ID,Price)
SELECT d.ID, d.Price
FROM deleted d
April 8, 2010 at 2:54 am
Viewing 15 posts - 916 through 930 (of 1,825 total)