Viewing 15 posts - 11,041 through 11,055 (of 22,219 total)
riya_dave (4/23/2012)
I AM ALREADY PUTTING IT INSIDE CURSOR BUT ITS REPEATING AGAIN AND AGAIN
I've no doubt you know this, but I'll point it out, just in case, all caps like...
"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 23, 2012 at 2:31 pm
Sounds like what you want is a cursor. Read up on those here.
But, please note, that's a very problematic way of dealing with data within SQL Server. Performance is notoriously...
"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 23, 2012 at 2:14 pm
riya_dave (4/23/2012)
i need something like untill there is value the loop should go.
i cant give any condition
suppose files
item1
...
"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 23, 2012 at 2:03 pm
Brandie Tarvin (4/23/2012)
Hijacking the thread for another book announcement.You can read the details on the top post of my Google+ stream here: Legend of the Beemen
Huge congratulations. Quite the...
"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 23, 2012 at 12:10 pm
riya_dave (4/23/2012)
kindly help me
i want insert
insert into #temp3
select I1,account,id from account(p1)
union
select I1 from #temp2
i cant do this coz of union,what are other ways of i...
"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 23, 2012 at 9:09 am
jcrawf02 (4/23/2012)
Brandie Tarvin (4/20/2012)
Grant Fritchey (4/20/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 23, 2012 at 9:05 am
It's parameter sniffing at work. When you use local variables, you get a scan of the statistics (unless a recompile is involved). When you use parameters, you get a search...
"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 22, 2012 at 4:31 am
Wait, what was the solution?
"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 21, 2012 at 4:27 am
Based on that, you also could just be looking at contention on the second server. However, from what you said, you saw two different execution plans. Two plans are caused...
"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 9:30 am
If by script you mean you didn't run a stored procedure? It might mean that you're seeing bad parameter sniffing. Which, again, could be caused by differences in statistics.
Remember, I'm...
"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:57 am
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
Viewing 15 posts - 11,041 through 11,055 (of 22,219 total)