Forum Replies Created

Viewing 15 posts - 3,211 through 3,225 (of 5,502 total)

  • RE: using all in a parameter in a stored procedure

    Paul White NZ (7/2/2010)


    lmu92 (6/30/2010)


    The best one I've seen so far is by Jeff Moden and posted here.

    Interesting. Even though I am credited on that post with a...



    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: Rounding in group by with rollup

    Would the following code give you the expected result?

    SELECT

    CASE WHEN (Grouping(Store) = 1) THEN 'Report Total' ELSE Store END AS report_total,

    Product,

    Store,

    CASE WHEN (Grouping(Store) = 1) THEN...



    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: XML to Table

    Here's an alternative to Waynes second query.

    Depending on the data structure of the xml file it might perform better.

    -- to get all KeyTypes for the user, different approach:

    SELECT...



    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: Is there a Do While loop?

    Assuming you're using SQL2000 then the following approach might help:

    SELECT

    User_ID as Field1,

    'Monday' as Weekday,

    Prg_Hrs_Monday=Prj_Hrs

    FROM YourTable

    UNION ALL

    SELECT

    User_ID as Field1,

    'Tuesday' as Weekday,

    Prg_Hrs_Tuesday=Prj_Hrs

    FROM...



    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 dynamic query

    Any chance to be a little more specific?

    E.g. by providing table def and sample data of the table involved together with a few scenarios to cover?

    This would actually help us...



    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: sequencing through rows based on account number changes...

    Triple post.

    So far, most replies here.



    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?

    GilaMonster (7/1/2010)


    I should bloody hope that a test with 1000 rows returns in under a second. It requires a really bad query to process 1000 rows in more than 1...



    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?

    Some posters sure have a strange perspective regarding performance...



    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 all in a parameter in a stored procedure

    chris-736523 (7/1/2010)


    ...

    lmu92,

    I tested both versions in question above. Both return more than 1000 values in less than 1 second. If you want to split hairs, can 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: using all in a parameter in a stored procedure

    chris-736523 (6/30/2010)


    I do this frequently.

    I'll declare the input parameter as

    @ParameterName VARCHAR(4000)

    Then, whatever is calling the procedure needs to pass a comma delimited string of values. Example "1,2,3,4,5,6".

    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: Dynamically create stored procedures in a database using stored procedure in second database

    What exactly is your question? :unsure:



    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: Finding the sum of date difference of a tricky situation using sql

    Based on your sample data, wouldn't it simply be

    SELECT cust_num, SUM(dayslate) AS res

    FROM mytable

    WHERE [TYPE]='P'

    GROUP BY cust_num



    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 all in a parameter in a stored procedure

    If you're using SQL Server 2008 you could pass the values as a table variable parameter.

    An example is given here.

    Regarding "ALL records": it depends how you pass the data...



    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: Finding the sum of date difference of a tricky situation using sql

    Your verbal description is not really telling me what you're trying to do.

    Please provide table def, sample data, expected result and what you've tried so far in a ready to...



    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: Rounding in group by with rollup

    One option would be to wrap your example inside a cte and use a conditional conversion in an outer query (using CASE statement).

    If you'd like to see a coded version...



    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 - 3,211 through 3,225 (of 5,502 total)