Forum Replies Created

Viewing 15 posts - 46 through 60 (of 127 total)

  • RE: Performance comparison for VIEWs & TABLEs

    The view-based query might be performing "as expected" for what it is. The view has some huge obstacles to overcome: the views are using cross joins -- joins do...

  • RE: Sequencing

    Please give a look at the "ranking" functions such as "row_number()" and "rank()" in books online. Pay particular attention to use of the OVER() clause in conjunction with both...

  • RE: Trigger Vs Output Clause

    My general preference for the situation you describe is to use the trigger. I prefer this mainly because this bonds the auditing to the table rather than rely on...

  • RE: Finding the latest record in a month

    I gave an SQL 2005 answer because we are in the 2005 forum; hang on and I'll review; sorry.

  • RE: How to update table without primary key

    It looks to me like you can use a straight-up UPDATE statement without bothering with the cursor -- what is preventing this?

  • RE: Finding the latest record in a month

    One alternative using CROSS APPLY might look something like:

    select distinct

    GroupID,

    b.valueId,

    b.valueDate,

    b.amount

    from theTable a

    cross apply

    ( select top 1

    ValueId,

    ...

  • RE: How to Loop

    There are a number of ways to do this. The first way -- probably the best way in this case -- is to do all of the work in...

  • RE: Cursor not working

    I don't think you need to worry about helping Jeff be well rounded; look at the Avatar -- a "circle" is a primary feature! 🙂

  • RE: Warning Message....

    The results of this query are the expected results:

    select

    count(*) as theCount,

    avg(n) as theAverage

    from

    ( select 1.0 as n union all

    select 3.0 union all

    select...

  • RE: Warning Message....

    Usually this means that your statement contains aggregate functions -- such as SUM, MAX or MIN -- that are operating on NULL values. As you have seen most likely...

  • RE: Cursor not working

    I was working with Sybase before they implemented cursors. Cursors came out and they were the new buzzword. Managers wanted cursors, cursors and more cursors -- and THEY...

  • RE: Cursor not working

    Hmm 99.99%. Maybe as far as cursors go you "can't loathe them enough."

  • RE: Replace carriage return with break

    Augusto,

    If by "break" character you mean an ascii control-o you ought to be able to use the REPLACE function with something such as:

    declare @cr_char char(1) set...

  • RE: Cursor not working

    I guess I need to also confess that I will at times over-react to cursor based code so take it a little with a grain of salt. Also, please...

  • RE: Get First row value

    I completely agree with the last two comments.

Viewing 15 posts - 46 through 60 (of 127 total)