Forum Replies Created

Viewing 15 posts - 1,246 through 1,260 (of 5,502 total)

  • RE: Passing Multi-Value Parameters to SQL Server Stored Procedure

    It seems like the statistics of All_Data_Export are out of date (estimated: 1.2mill rows vs. actual 180k).

    Did you try to use the CROSS APPLY approach instead of the JOIN on...



    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: Passing Multi-Value Parameters to SQL Server Stored Procedure

    Please post the table def for dbo.All_Data_Export including all index definitions as well as the actual execution plan (attached as sqlplan file). It seems like there is no covering index.



    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: Optimize query

    Are there any indexes on dbo.Preguntas?

    If so, can you post the index definition, 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]

  • RE: Records from yesterday if not monday

    I would slightly change the CASE function to protect against wrong results using a different @@language setting:

    case datediff(dd,0,dateadd(dd, N, @RunDate )) % 7

    when 0 then 3

    else 1

    end



    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 query alternative for performance improval

    What is the business logic behind it?

    All of the subqueries use a TOP 1 without an ORDER BY. What's the purpose?

    Why not simply using the following approach (example of one...



    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: Single table row-column comparison issue

    Please stay consistent with your explanation.

    In your original example you used 'f%' but not 'x%'. In your latest reply you mentioned 'flr%' but not 'px%' presenting sample code that doesn'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: Parsing XML file

    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: Help Needed for to Improve SQL Query Performance

    Please post the index definitions you might have on your source tables.

    I recommend to add an index on #DataHistory(ID,historyid) and #Data(ID).

    Other than that, all I can think of to speed...



    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: ISNULL QUESTION

    Please don't hijack other threads (even more if those threads are almost three years old).

    Open a new thread and post your question with more a more detailed description than just...



    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 to use Cursor to get desired result.

    At a first glance it looks like for some values in Item_Name the Opening values are running totals but for other values those are plain values.

    For instance, the opening...



    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 to get count for week range?

    I strongly vote against using DATEPART(ww) since it depends on the setting of @@DATEFIRST which can be changed either by SET DATEFIRST or SET LANGUAGE or the language setting of...



    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: Single table row-column comparison issue

    Are you looking for something like this?

    declare @tbl table

    (col1 int, col2 char(2))

    insert into @tbl

    SELECT 1,'x1' UNION ALL

    SELECT 1 ,'f2' UNION ALL

    SELECT 2 ,'f1' UNION ALL

    SELECT 3 ,'x3' UNION ALL

    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: Parsing XML file

    Something like this?

    SELECT

    T.c.value('@table[1]','VARCHAR(30)') as TableName,

    U.v.value('@column[1]','VARCHAR(30)') as ColumnName,

    U.v.value('.[1]','VARCHAR(30)') as LookupValue

    FROM @xml.nodes('lookupsEntry') T(c)

    CROSS APPLY T.c.nodes('value') U(v)



    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 query alternative for performance improval

    Please post table def and sample data in a ready to use format as described in the first link in my signature.

    Also, please include your expected result based on 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: Inserting millions of rows into a partitioned view

    What table would a value for DateColumn ='20100101' get inserted? 😉



    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,246 through 1,260 (of 5,502 total)