Forum Replies Created

Viewing 15 posts - 48,691 through 48,705 (of 59,065 total)

  • RE: Need Help In Getting Required Result

    Jeff Moden (8/17/2008)


    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...

  • RE: Need Help In Getting Required Result

    karthikeyan (8/11/2008)


    If we convert it into a SP, then we can change the input values as required.

    Create Procedure PrintReverse

    (

    @NumberToReverse int,

    @NoOfTimesRepeat int

    )

    Select REPLICATE(@NumberToReverse,N)

    from Tally,NUM

    where N <= @NoOfTimesRepeat

    and NumberValue = @NumberToReverse

    UNION...

  • RE: Need Help In Getting Required Result

    karthikeyan (8/11/2008)


    Christopher,

    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...

  • RE: Need Help In Getting Required Result

    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...

  • RE: Deadlocks rate

    Niyala (8/11/2008)


    Hi, all,

    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...

  • RE: MAX() Function Call from Application

    ... and it will require a change to your front end statement. You will need to select from the indexed view, instead.

  • RE: MAX() Function Call from Application

    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.

  • RE: OpenRowSet Import Excel to SQL Server

    I believe the first sheet of an Excel file can be referred to as Sheet1$ regardless of it's actual name.

  • RE: Instead of Using Cursor? Other Ways?

    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...

  • RE: Instead of Using Cursor? Other Ways?

    Lester Policarpio (8/13/2008)


    "I think" it can be done using a tally table. Some experts here in the forum maybe can share something about it.

    And also please read the article...

  • RE: GOTO vs WHILE

    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...

  • RE: reset sequence when value of one column changes

    Loner (8/13/2008)


    It is SQL Server 2000 so I cannot use RANK, that is why I posted the question in this forum.

    The one you posted for SQL Server 2000 worked liked...

  • RE: Arrays

    You can get by without creating the extra temp table...

    SELECT d.Name,t.N*10 AS DeciCount

    FROM (SELECT Name,COUNT(*) AS TheCount

    ...

  • RE: Selecting The Top 3 Numbers Used The Most

    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...

  • RE: dbo

    It means "DataBase Owner" and is a server role. Lookup server roles in Books Online.

Viewing 15 posts - 48,691 through 48,705 (of 59,065 total)