Forum Replies Created

Viewing 15 posts - 3,166 through 3,180 (of 3,957 total)

  • RE: Calculated column Only for Insert

    R.P.Rozema (7/23/2012)


    Then while you're at it, don't use getdate() for the timestamp on your audit data and don't use current_timestamp either. Instead I suggest to use getutcdate().

    Using getutcdate() ensures that...

  • RE: odd sproc behavior

    CELKO (7/21/2012)

    Triggers are another bad code smell. It uses procedural code to fix design errors on the fly when you could not think of a declarative solution. Mother Celko's rule...

  • RE: UNPIVOT an flat Tabel

    Do you mean something like this?

    SELECT MatchResultMatchId

    , MatchResultLicNbr

    , MatchResultShirtNo

    , CONVERT(VARCHAR(12), [Round]) [Round]

    , Result

    FROM dbo.bo_MatchResultTest

    CROSS APPLY (

    VALUES (1, MatchResultRoundResult1)

    ,(2,...

  • RE: Query help to update with next records

    ALZDBA (7/23/2012)


    Dear, Jeff, forgive me because I have sinned.

    I hope you don't kick me out of the anti RBAR brotherhood.

    He almost revoked my anti-RBAR card once for sinning...

  • RE: Grouping and Sorting sequential data by street address

    CELKO (7/20/2012)


    Address data is formatted using the CASS specs from USPS and you can get software that will assist you. Have you ever heard of a SAN (Standard Address Number)?...

  • RE: Last Modified

    geidy_killer: Thread hijacking issues aside, you may find the information you seek in this forum post: http://www.sqlservercentral.com/Forums/Topic1332707-392-1.aspx

    Look for answers in it from Kingston and me.

  • RE: Derived field help

    Canazei65 (7/16/2012)


    Hi

    RowIDRegisteredSpendDate FinancialYrSpendPerFinYr($) FinQtr ForecastSpendPerQtr

    ...

  • RE: Query help to update with next records

    Jeff Moden (7/22/2012)


    ChrisM@home (7/22/2012)


    Without an ORDER BY, TOP is meaningless:

    SELECT

    t1.col1,

    col2 = ISNULL(t1.col2, x.col2)

    FROM @T t1

    OUTER APPLY (

    SELECT TOP 1

    t2.col2

    FROM @T t2

    WHERE t2.col1 > t1.col1

    AND t2.col2...

  • RE: Calculated column Only for Insert

    Kingston's solution is true enough as it goes, but you can also assign a default constraint to the update date column and then use this whenever a row is updated.

    As...

  • RE: Transform data into 2 more columns

    This will also work:

    create table #t1 (Invoice_no int, item VARCHAR(5), price MONEY)

    insert into #t1 select 102,'#1', 6.21

    union all select 102,'#2', 3.56

    union all select 102,'#3', 4.28

    union all select 105,'#4', 1.90

    union...

  • RE: Get running total in the following query

    I must be missing something but I don't see how that recursive CTE (as much as I like rCTEs) accounts for the RunningTotal existing on the last record that already...

  • RE: Exploring Recursive CTEs by Example

    Holy One (7/18/2012)


    Surely it's the Ark of the Covenant?

    I agree that the Ark of the Covenant should have surely been included in my haul. Alas, my fence didn't think...

  • RE: Exploring Recursive CTEs by Example

    SQL PROCtologist (7/17/2012)


    FINALLY!!! Someone who loves burning up the CPU as much as I do! 😀

    As a token of gratitude, feel free to add my recursive string parser to your...

  • RE: Exploring Recursive CTEs by Example

    Peter H (7/17/2012)


    Great article, thanks. I really enjoyed going through that.

    I am looking for CTE's that will give me formulae for different predictive analysis routines.

    here is a slight coding problem,...

  • RE: Exploring Recursive CTEs by Example

    Steven Willis (7/17/2012)


    Just yesterday by coincidence I needed a query to parse dynamic XML with different nodes and properties on each run and came up with this procedure using CTEs...

Viewing 15 posts - 3,166 through 3,180 (of 3,957 total)