Viewing 15 posts - 2,671 through 2,685 (of 5,502 total)
gmrose (10/21/2010)
October 22, 2010 at 8:45 am
That explains the bad performance pretty much...
You're using a table variable just like I did for my demo version. :blush: My fault. I'm sorry.
A table variable is a bad option...
October 21, 2010 at 12:56 pm
gmrose (10/20/2010)
October 21, 2010 at 8:55 am
Craig Farrell (10/20/2010)
Lutz, that is wild. I like it. Thanks. :w00t:Have you done that on huge recordsets? Does it perform well?
No, I haven't. And I probably won't either.
Such...
October 20, 2010 at 6:12 pm
You might want to compare the performance of your loop with the following code.
I can't tell you if it'll return the same results since I have nothing to test against,...
October 20, 2010 at 5:00 pm
It's slightly more complicated than just using a CTE...
DECLARE @tbl TABLE
(
ckid INT,stat VARCHAR(10)
)
INSERT INTO @tbl
SELECT 101 ,'Open' UNION ALL
SELECT 102 ,'Open' UNION ALL
SELECT 103 ,'Open' UNION...
October 20, 2010 at 4:42 pm
Something along those lines?
SELECT
id,
CASE
WHEN EXISTS (SELECT 1 FROM #TblTemp t2 WHERE t1.id=t2.id AND Price=9999.9999)
THEN 1111.1111
ELSE AVG(Price) END AVGPrice
FROM #TblTemp t1
GROUP BY Id
October 20, 2010 at 3:06 pm
Did you search this site for "DelimitedString8K" on this site?
This is a function posted by Jeff Moden. If you get the "right thread" (don't recall the link right now) you'll...
October 20, 2010 at 2:56 pm
GilaMonster (10/20/2010)
For the second one, check out the thread over at SQLTeam with the same question.
I followed the link you posted and it seems like the OP is not erally...
October 20, 2010 at 2:50 pm
Is it just because I'm in a bad mood today or why do I have the feeling that todays questions are more demanding with even less effort than on other...
October 20, 2010 at 2:17 pm
Uripedes Pants (10/20/2010)
October 20, 2010 at 2:05 pm
SeanLange (10/20/2010)
LOL Lutz. 😀
What's so funny about it? I found it rather sad... :crying:
October 20, 2010 at 1:58 pm
You need to use XQuery.
Side note: A great resource for several XQuery solutions is Jacob Sebastians blog
DECLARE @tbl TABLE
(
id INT,
col XML
)
INSERT INTO @tbl
SELECT 1,'<Product>
<name>car</name>
<color>red</color>
<type>sedan</type>
</Product>'...
October 20, 2010 at 1:56 pm
Your requirement is not clear.
What do you mean by "auto generate"? Are you looking for some kind of an identity column in a custom format?
To ensure you only have unique...
October 20, 2010 at 1:55 pm
Viewing 15 posts - 2,671 through 2,685 (of 5,502 total)