Forum Replies Created

Viewing 15 posts - 1,741 through 1,755 (of 5,502 total)

  • RE: Counting multiple records as one

    Glad I could help! 😀



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Select Distinct on indexed column is not instant

    What type of index did you create (clustered or non-clustered)? If it's the clustered index you still perform a table scan...

    As a side note: why do you use VARCHAR(3) instead...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Counting multiple records as one

    Here's a slightly more complicated solution:

    ; WITH cte1 AS

    (

    SELECT

    *,

    DATEADD(mi,DATEPART(MINUTE,phonetime)/15 *15,DATEADD(hh,DATEDIFF(hh,0,Phonetime),0)) AS INTERVAL

    FROM #PhoneCalls

    ), cte2 AS

    (

    SELECT

    customerid,

    INTERVAL,

    ROW_NUMBER() OVER(PARTITION BY INTERVAL ORDER BY phonetime)-

    ROW_NUMBER() OVER(PARTITION BY...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Using split function for multivalue selection within stored procedure

    If you have any further question or if you get stuck, please post back and I'm confident we can help you.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Execution Query Cost vs Profiler stats

    From my point of view the query cost in the actual execution plan is even more misleading than the recommended indexes DTA comes up with (comparing apples and oranges, I...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Using split function for multivalue selection within stored procedure

    There are several issue to be adressed:

    1) it seems like the code snippet you posted is part of a dynamic SQL statement... (otherwise there's no reason to use two single...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: DateDiff with Months datepart - ILLOGICAL

    When you're asking for the difference in months, SQL Server basically truncates the days of the dates you compare:

    For example:

    SELECT DATEDIFF(mm,'20101231','20110101')

    SELECT DATEDIFF(mm,'20101201','20110131')

    Both queries return the same value (1), since the...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: CTE vs Derived Tables

    Glad I could help 😀

    A second set of eyes helps a lot from time to time. Especially, if there's no mouth connected to it... 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: CTE vs Derived Tables

    I don't think you need the UNION ALL in your CTE:

    SELECT DTConID, TransactionType,

    Sum(Convert(decimal(12,2),CASE WHEN AmtSign = '-' THEN 0 -...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: 10 rows to check the high value and do some calcs

    What is the order criteria to get the values for I_Serial?

    Regarding getting ready to use sample data out of SSMS: please have a look at the first article referenced in...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: 10 rows to check the high value and do some calcs

    Please provide some sample data in the form "INSERT INTO ... SELECT ... UNION ALL" and your expected result based on the sample. Especially, please make sure to explain what...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: TSQL parsing out a URL

    Here's a slightly different approach:

    SELECT SUBSTRING(URLs,8,charindex('/',URLs+'/',8)-8) AS URLs

    FROM @URLTable



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Normalization of existing database

    Step 1: Understand normalization. You could google for "database design normalization" to get several links to cover the basics.

    Step 2: Understand the meaning and purpose of the data you're dealing...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: sql question

    I just voted for "plz send answer". 🙂

    Strong hint: a poll is not really useful to ask a question. You should start a thread in the related forum section.

    The chance...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: convert to SQL2005

    If it's an option I would recommend to move to 2K8 instead of 2K5.

    Keep in mind that mainstream support for 2K5 will end in less then a month (4/12/2011).



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 1,741 through 1,755 (of 5,502 total)