Forum Replies Created

Viewing 15 posts - 2,146 through 2,160 (of 5,502 total)

  • RE: Select statement of view stays 5 hours to return results......

    It's just not as easy as you might think to work on such a rather large query without any sample data to play with ... 😉

    All we have is 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: extract the number before %

    Would a simple REPLACE(YourValue,'%','') do the trick?



    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 statement of view stays 5 hours to return results......

    JMSM (1/9/2011)


    Thanks a lot LutzM.

    I'll change the function as u tell me.

    Regards,

    JMSM 😉

    The function issue is not the only problem (might not even be the most relevant one).

    So, please follow...



    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: How do I know exactly which rows will need to go into the GROUP BY clause

    GROUP BY is used to perform aggregation.

    So you'd need to add every column of your SELECT statement where you don't perform any sort of aggregation (min, max, avg, sum, count).

    That...



    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 statement of view stays 5 hours to return results......

    There are several approaches you can use:

    Most important:

    instead of applying a function to your columns rewrite it as SARGable arguments:

    datediff(d, i.LstMdfation, getdate()) < 30

    -- would be

    i.LstMdfation>dateadd(dd, -30, getdate())

    Another...



    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: Display column of different rows as column of a single row

    sandeepmittal11 (1/9/2011)


    Check out this link

    <a href="http://itdeveloperzone.blogspot.com/2010/12/display-column-of-different-rows-as.html">Display column of different rows as column of a single row</a>

    Did you realize this thread is almost two years old?

    And the link you posted shows...



    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: Cross join query help

    A few things to notice:

    When running queries against datetime values stored in your db you should not convert those values to varchar in order to do any comparison. This will...



    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: Time Slot Availability

    Here's something that should get you started.

    A few things to notice:

    Instead of using an on-the-fly tally table you should considerto build a permanent one. It's quite helpful in many scenarios,...



    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: Query converted into Dynamic SQL string within Stored Proc yields syntax error

    I just tried to print your dynamic statement and it returned:

    SELECT emp_id, emp_name + COALESCE(NULLIF('(' + COALESCE(CAST(emp_number AS varchar(10)),') +')','(' + ')'),') AS display_name from Employee ORDER BY emp_name

    It seems...



    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: delete stored procedure for relationship many to many

    Why don't you use a foreign key concept and the cascade delete option?



    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: Time Slot Availability

    Are the data in your [ProctorSlot] the time spans already reserved?

    If so, you could use a calendar table together with a tally table to get your "N" min interval.

    I don't...



    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: require additional memory?

    Yep, Tuning Advisor to provide some "hints" is about all that's available with SS2K.

    Isn't it amazing, how little time is needed until we forget how hard it was to tune...



    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: URGENT: SQL Pivot Help Please!

    It depends on what you're looking for...

    I'd use ROW_NUMBER istead of RANK. This will return values 10 and 11 for 'Top 7 Raw'.



    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: Pivot Query help

    Please have a look at the DynamicCrossTab article referenced in my signature.

    It seems like exactly what you need...



    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: Are the posted questions getting worse?

    Google seems to be down, too.



    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 - 2,146 through 2,160 (of 5,502 total)