Viewing 15 posts - 4,921 through 4,935 (of 15,381 total)
I don't see anything wrong with the code. I would however point out that what you are doing is very brittle. You are storing aggregate data from one table in...
May 13, 2014 at 7:31 am
rhythmk (5/13/2014)
;WITH test
AS
(SELECT POLICY_DETAILS_ID,HISTORY_ID,CODE_ID,
ROW_NUMBER() OVER(PARTITION BY POLICY_DETAILS_ID,HISTORY_ID ORDER BY code_id) AS rn
FROM @POLHIST)
SELECT POLICY_DETAILS_ID,HISTORY_ID,
MAX(CASE WHEN rn = 1 THEN code_id...
May 13, 2014 at 7:19 am
Ed Wagner (5/12/2014)
Stefan Krzywicki (5/12/2014)
TomThomson (5/12/2014)
Ed Wagner (5/12/2014)
Sean Lange (5/12/2014)
Lynn Pettis (5/12/2014)
Sean Lange (5/12/2014)
Ed Wagner (5/12/2014)
May 12, 2014 at 2:13 pm
Hi and welcome to the forums. In order to help we will need a few things:
1. Sample DDL in the form of CREATE TABLE statements
2. Sample data in the form...
May 12, 2014 at 12:32 pm
We could probably look at reworking this entirely so that it is set based instead inside a while loop. That would increase the performance greatly and would eliminate all the...
May 12, 2014 at 12:24 pm
jdasilva (5/12/2014)
I had hit hte execute...
May 12, 2014 at 12:12 pm
jdasilva (5/12/2014)
Sean Lange (5/6/2014)
jdasilva (5/6/2014)
In the example I am working on, I am polling the data for...
May 12, 2014 at 10:41 am
mattech06 (5/12/2014)
The performance seems fine, I'll test it with our biggest client tomorrow but I'll note your comments/links anyway for future ref, thanks.
Make certain you read that article. It is...
May 12, 2014 at 10:29 am
Here is another way.
where (@userParam = 'No Group' and pg.ProGroup IS NULL)
OR
pg.ProGroup = @userParam
The problem with this approach is the query plan may need to be different depending on the...
May 12, 2014 at 10:01 am
SQLalchemy (5/12/2014)
Can someone tell me what this phrase is doing? Found it in some code I'm inheriting:WHEN PATINDEX ('%[^0-9-]%', @Num) = 0
It is a regular expression...or as close as t-sql...
May 12, 2014 at 9:55 am
Lynn Pettis (5/12/2014)
Sean Lange (5/12/2014)
Ed Wagner (5/12/2014)
Sean Lange (5/12/2014)
paul.knibbs (5/12/2014)
May 12, 2014 at 9:53 am
Ed Wagner (5/12/2014)
Sean Lange (5/12/2014)
paul.knibbs (5/12/2014)
May 12, 2014 at 8:52 am
paul.knibbs (5/12/2014)
May 12, 2014 at 8:43 am
Another way to do this is by using a cross tab. I used Erikur's data as a starting point. This will be better performance wise because it doesn't have to...
May 12, 2014 at 7:41 am
I assume your temp table is a persistent table in your actual system? something like this?
CREATE FUNCTION dbo.MyInlineTableValueFunction()
RETURNS TABLE WITH SCHEMABINDING AS
RETURN
select Distinct UniqueID, RecordingDate
--, ROW_NUMBER() over (Partition by...
May 9, 2014 at 2:30 pm
Viewing 15 posts - 4,921 through 4,935 (of 15,381 total)