Viewing 15 posts - 48,691 through 48,705 (of 59,065 total)
Jeff Moden (8/17/2008)
It's odd that you must use a While loop instead of a cursor because a cursor uses a While loop! They both suck performance dry. 🙂
I'd...
August 17, 2008 at 8:49 pm
karthikeyan (8/11/2008)
Create Procedure PrintReverse
(
@NumberToReverse int,
@NoOfTimesRepeat int
)
Select REPLICATE(@NumberToReverse,N)
from Tally,NUM
where N <= @NoOfTimesRepeat
and NumberValue = @NumberToReverse
UNION...
August 17, 2008 at 8:48 pm
karthikeyan (8/11/2008)
why can't we use Tally or Number table ?
My approach :
Select REPLICATE('1',N),N
from Tally,NUM
where N <= 6
and NumberValue = 1
union all
select REP,N from (Select REPLICATE('1',N) as REP ,N
from Tally,NUM
where...
August 17, 2008 at 8:46 pm
Hi Trevor...
It's odd that you must use a While loop instead of a cursor because a cursor uses a While loop! They both suck performance dry. 🙂
I'd recommend that...
August 17, 2008 at 8:32 pm
Niyala (8/11/2008)
I am getting the following deadlock message, but I could not figure out what the mentioned rate is.
DBSPI-3271.1: Deadlocks rate for object _Total (110.00/sec) too high (>=3.00/sec)
I...
August 17, 2008 at 8:00 pm
... and it will require a change to your front end statement. You will need to select from the indexed view, instead.
August 17, 2008 at 7:59 pm
You might be able to get a whole lot more retrieval speed if you created an Indexed View. Be warned that an indexed view can slow down inputs some.
August 17, 2008 at 7:52 pm
I believe the first sheet of an Excel file can be referred to as Sheet1$ regardless of it's actual name.
August 17, 2008 at 7:46 pm
pockeyfan (8/14/2008)
Thanks for your suggestion!I'm new to SQL and SP, will read the article to see whether I could apply it in my case...
Tally table won't do it, in this...
August 17, 2008 at 7:40 pm
Lester Policarpio (8/13/2008)
And also please read the article...
August 17, 2008 at 7:17 pm
Heck... I wouldn't even use the WHILE loop... it's RBAR. Most WHILE loop solutions are because someone doesn't know T-SQL well enough to come up with the proper set...
August 17, 2008 at 7:05 pm
Loner (8/13/2008)
The one you posted for SQL Server 2000 worked liked...
August 17, 2008 at 7:00 pm
You can get by without creating the extra temp table...
SELECT d.Name,t.N*10 AS DeciCount
FROM (SELECT Name,COUNT(*) AS TheCount
...
August 17, 2008 at 6:53 pm
Lian Pretorius (8/12/2008)
karthikeyan (8/12/2008)
Hey Trevor,I have tested the below script, It is giving perfect result.
Same here.
Trevor, Karthik's script above uses a temp table - Which cannot be used in view's...
August 17, 2008 at 6:45 pm
Viewing 15 posts - 48,691 through 48,705 (of 59,065 total)