Viewing 15 posts - 11,056 through 11,070 (of 22,224 total)
Tried one more. It won't be right either, but an effort was made.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 8:53 am
riya_dave (4/20/2012)
and this udf returns table,not scalar
Not defined in the original sets of posts. See why so many people are having trouble understanding what's going on?
How about something like this:
JoinedTable.account,
COALESCE(JoinedTable.mtd1,(JoinedTable.mtd2+i1.VALUE)
(SELECT...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 8:52 am
Lynn Pettis (4/20/2012)
I wanted to say...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 7:49 am
David Burrows (4/20/2012)
INSERT #temp3 (account,MTD,ytd)
SELECT t1.account,
COALESCE(t1.MTD,t1.m1 + account(@p1)),
COALESCE(t1.ytd,t1.y1 + account(@p1))
FROM #temp1 t1
LEFT JOIN #temp2 t2 ON t2.account = t1.account...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 7:45 am
I am making an honest attempt to help out here.
First, I had to change your code because it won't run. Here are the updates:
CREATE TABLE #temp1 (
account INT,
...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 7:44 am
I'm trying to understand, but I just don't get what you're doing. I'm sorry.
How do you get from this result set:
1001 23.45 34.32
1003 34.56 43.21
1003 null null.
To this result set:
1003...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 4:13 am
The Dixie Flatline (4/19/2012)
Yes, Gail, I was at the last Summit...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 4:05 am
Brandie Tarvin (4/19/2012)
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 4:00 am
Not knowing the internals of the multi-statement UDF, it's hard to know what to do about it, but those things are notorious performance pigs if you're dealing with more than...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 3:58 am
Not seeing all the code & structures involved... not sure. Just guesses. Maybe moving to a tempdb creates a more up to date set of stats. Maybe moving to tempdb...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 3:53 am
Also check the server settings, especially default connection settings. If one is using ANSI standard and the other is not, again, you might get different execution plans.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 20, 2012 at 3:51 am
This is just because recruiters and HR departments only have a list of requirements, not actual knowledge. If you don't meet the list, you don't meet the list. The only...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 19, 2012 at 4:20 am
It might be statistics that are out of date, but from the sounds of it, I'd want to be sure that the structures are identical, that the code in both...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 19, 2012 at 4:15 am
Your statistics look to be off. You've got implicit data conversions on all your predicates, possibly causing all the scans, and it looks like you may have a multi-statement table...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 19, 2012 at 4:11 am
It's absolutely a problematic approach to a JOIN. Functions like that means you can only ever scan the table.
The reason it might be erroring out so quickly is because...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 19, 2012 at 3:41 am
Viewing 15 posts - 11,056 through 11,070 (of 22,224 total)