Forum Replies Created

Viewing 15 posts - 166 through 180 (of 5,502 total)

  • RE: SQL procedure Query Performance issue

    I recommend the following steps to change it into a remote query:

    1) change the main query completely into a dynamic query so it will run when using EXECUTE(@sql) where @sql...



    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 procedure Query Performance issue

    mallikachowdhary 98955 (7/26/2014)


    ...

    I have attached the query as attachment name "main query" which takes time.

    I have also attached the modified query as "open query".

    Where can I find the queries?



    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 with Linked Server: Mulitpart Identifier could not be bound

    Since it'll break all of a sudden and then work as usual I'd add a TRY CATCH block to the sproc where the CATCH block would call a separate sproc...



    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 with Linked Server: Mulitpart Identifier could not be bound

    Did you try what I proposed to find the table in question?



    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 with Linked Server: Mulitpart Identifier could not be bound

    I don't think it will help at all to know the linked server that is referenced.

    The OP should try a

    SELECT TOP 1 AUFNR FROM afpo

    SELECT TOP 1 AUFNR 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: What is Automation in sql server?

    Would you mind being a little more specific?

    A SQL Server Agent job can be considered as "automation", for instance...



    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 with Linked Server: Mulitpart Identifier could not be bound

    Seems like there are some views involved since there's no reference to Tbl1008 in the code you've posted.

    Most probably the underlying data structure has changed without notice (as usual when...



    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: Deny db_name(), @@Version and related

    All I can think of is to deny SELECT in general and only allow EXECUTE.

    However, I don't know if this will also work for system variables.



    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 Server 2008 R2 Error: An error occurred while executing batch. Error message is: Error creating window handle.

    I don't think it's an issue of the queries being "large".

    More likely the two while loops *cough* generate a huge number of execution plans being generated and displayed leading 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: Selecting the top record with certain conditions

    I'm sorry Lynn for not providing any addtl. information how I ended up with the solution I posted....

    Here's the "story behind":

    I looked at the result set based on the sample...



    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 to find missing indexes

    Try this link.



    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: reverse lookup? everse lookup? (SELECT x FROM table) IN note LIKE %xy%

    Lynn Pettis (5/18/2014)


    ...

    Depending on how many rows and columns are in the lookup table, a table scan of the lookup table may not be an issue. If we are...



    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: Selecting the top record with certain conditions

    Here's a slightly different approach using CROSS APPLY:

    ;WITH cte as

    (

    SELECT id_resource, max(id_shift) as last_shift

    FROM @mytable

    WHERE actionKindCode='section_decoupling'

    GROUP BY id_resource

    )

    SELECT x.id_action, x.id_resource, x.actionKindCode

    FROM cte

    CROSS APPLY

    (

    SELECT TOP 1 id_action, id_resource, actionKindCode

    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: reverse lookup? everse lookup? (SELECT x FROM table) IN note LIKE %xy%

    ...The reason text is variable length text, and should be at the start of the note... but cannot be guaranteed...

    This will force the query to perform a table scan since...



    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: Upgrade to sql 2014

    One reason could be the end of the Mainstream Support for 2008R2 (July 2014).

    On the other hand you'll need to be aware of the change in terms of licensing cost...



    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 - 166 through 180 (of 5,502 total)