Home Forums SQL Server 2005 T-SQL (SS2K5) TSQL Return start/end price and start/end datetime by product name. RE: TSQL Return start/end price and start/end datetime by product name.

  • Bhuvnesh (6/2/2010)


    elutin (6/2/2010)


    As promised, another version. It contains much more code, but it's probably the fastest way to do what you require:

    ...

    ,@Product = Name

    OPTION (MAXDOP 1)

    ...

    Do we need here (maxdop 1 ) ?

    Yes, it is a "must have" one. In case of parallel processing the state of variables cannot be guaranteed.

    The full explanation of method can be found in http://www.sqlservercentral.com/articles/T-SQL/68467/ nice article by Jeff Moden.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]