Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)

  • RE: TSQL PRoblm

    I considered the same solution Peter L, but encountered the problem of lopping off leading zeros. That's actually a common mistake that is included in report tester scripts. These aren't...

  • RE: TSQL PRoblm

    In the example provided above by RDR'us, instead of using the final SELECT proposed, you could use the following two queries with a performance gain of approximately 23.11%! How? When...

  • RE: Filling Gaps - Running Totals

    Step #4 is an excellent set-based method for determining the end_balance for the current month. May I also suggest that you eliminate the column "amt_change" and use "SUM(credit_amt + debit_amt)"...

  • RE: TSQL PRoblm

    San,

    Actually the best solution is the following:

    DROP TABLE refNo;
    
    DECLARE @email NVARCHAR(256), 
         @message NVARCHAR(2048), 
         @subject NVARCHAR(128);
    
    SELECT @email = 'boss@yourcompany.com',
      ...

  • RE: Filling Gaps - Running Totals

    Aw yeah!!! Well, I took care of the inserting missing rows dealio. With some freakin' crazy idea that hit me upside the head. *The update calculations have dependencies on other...

  • RE: Filling Gaps - Running Totals

    Are you going to need to process the "end_balance" every time? Can you initialize with NULL and then ignore on subsequent runs, or can it change?

  • RE: Filling Gaps - Running Totals

    Being a programmer, I like to tackle problems like this with cursors first and then massage it into a set-based (a.k.a. "good" or "real") solution.

    With that in mind, here you...

  • RE: Trigger Audit Trails - who deleted my record?

    I should have noted that users are using connection pooling on shared connections. Primarily web applications. So, SQL Server user and process functions will not properly identify a user.

    The column...

  • RE: MAX() vs. TOP 1 (fastfirstrow) DESC?

    In my experience, picky programmers are good programmers, even when their points can seem agitating. 

  • RE: MAX() vs. TOP 1 (fastfirstrow) DESC?

    I discovered that the table hint "fastfirstrow" is being deprecated in future versions of SQL Server, but did not find any documentation comparing the feature with similiar features.

    For my rather...

  • RE: TOP N vs. TABLE HINT (fastfirstrow)

    Okay... I've been around SQL Server for 7 years and had to figure out that "BOL" stood for Books on Line (sad, but true). Apparently the time to look...

  • RE: IF statement not seeming to work...

    Also... consider using RECOMPILE in the stored proc if the server would be better off not trying to re-use an execution plan.  You could also use the query hint for...

  • RE: Advanced Set-based Trigger (validating date ranges)?

    Here was the result I came up with... Jeff: I attempted to follow your notes and appreciated the test case examples. However, I did have difficulty translating the...

Viewing 13 posts - 1 through 13 (of 13 total)