Forum Replies Created

Viewing 11 posts - 15,361 through 15,371 (of 15,371 total)

  • RE: Error on BEFORE UPDATE Trigger

    Be VERY careful if you use Instead of triggers. I worked for client that put lots of business logic in a Instead of Insert trigger. We encountered an issue when...

  • RE: Encrypting SQL Code

    A few years ago I worked as a consultant for a large firm that did all their development in house. The enterprise application was massive. It spanned 3 separate databases...

  • RE: How to change the display results by using store procedure

    Aggregate columns get no column name unless you alias it. Do something like this:

    Select SocialSecurityNumber, ClearedDate, [Type], DDS, Count(*) as TotalCleared

    HTH

    Sean

  • RE: How to change the display results by using store procedure

    Start with your original code.

    Remove the TotalCleared column from your temp table.

    instead of :

    declare @cnt int

    select @cnt=count(*) from #temp

    update #temp set TotalCleared = @cnt

    select * from...

  • RE: How to change the display results by using store procedure

    Oh I see what you did. You should put all the inserts back to the original. The only change should be at the end.

    josephptran2002 (4/9/2009)


    Hello Slange,

    declare @cnt int

    select @cnt=count(*) from...

  • RE: How to change the display results by using store procedure

    Can you post the new code? I tested the code i put it up and it works fine. 😉

  • RE: How to change the display results by using store procedure

    You could try simply dropping the TotalCleared from #temp. It is not needed. The update you are doing to that column will always contain just the rowcount. I assume you...

  • RE: Linking to the Previous Row

    Bill Coale (3/13/2008)


    For this date range technique, for the end date:

    nextrow.PriceStartDate AS EndDate

    I usually do:

    dateadd(day, -1, nextrow.PriceStartDate) AS EndDate

    Also truncate to midnight the start/end date and any date comparisons...

  • RE: Understanding NULL

    Tao Klerks (11/18/2008)


    Hi slange,

    I think you're confusing a couple of possibilities.

    The query above reports employees who have no "subordinates" - there are no employees that have their employeeid in the...

  • RE: Understanding NULL

    Tao Klerks (11/18/2008)


    Hmm, nice one, I've never seen that issue described.

    That provides another reason why the following syntax is (in my opinion) preferable:

    select *

    from employees

    left join employees as...

  • RE: T-SQL

    I fell victim to a similair script at one point. :Whistling: As a result I now make it my standard habit that after the declaration of the sp i wrap...

Viewing 11 posts - 15,361 through 15,371 (of 15,371 total)