Forum Replies Created

Viewing 15 posts - 1,366 through 1,380 (of 5,502 total)

  • RE: SQL Server 2008 Query Problem

    I would test how many rows would the following join return:

    Inner Join on CostPrice = CostPrice and Reference = Reference AND LastUpdatedDate <= TransactionDate.

    Depending on the number of rows returned...



    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: need help for my query to get the number pattern.

    Oh, before I forget:

    To get the result you're looking for (desc order), just add an "ORDER BY cte_tally.n DESC" to the code I posted. 😉



    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: need help for my query to get the number pattern.

    I have to ask again: why do you insist in using a loop?

    Even if there is a set based solution available?

    It seems like performance is not on your...



    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: need help for my query to get the number pattern.

    jkp2311 (6/24/2011)


    Hi Lutz,

    Thanks for help me out.

    But it is difficult for me using CTE.

    anyway, i know we can do also another way using nested while loop.

    it's much easier 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: Evaluating SQL HA options for Disaster Recovery

    Steve mentioned the disconnects from any active clients when failover occurs for mirroring.

    That's a major difference to a cluster configuration where the IP (or the system name) doesn't change. 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: need help for my query to get the number pattern.

    If you insist in using a while loop: I don't know how to do it. 😉

    But here's a set based solution:

    declare @c1 int

    set @c1 = 5

    ;

    WITH cte_tally AS

    (SELECT Number +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: No se pudo ejecutar sqlmaint.exe. [SQLSTATE 42000] (Error 22029

    Maybe this link will help you to narrow down the root cause.

    As a side note: by choosing to post in a different language than English (especially in a thread header)...



    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: Data for the current week

    Craig Farrell (6/24/2011)


    ...

    I'm not necessarily sure I'd want SET LANGUAGE to be changing my DATEFIRST once I've specifically set it anyway, so your concern is actually a benefit to me....



    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: Insert based on condition

    You wold need to use dynamic SQL for such a requirement.



    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: Data for the current week

    @craig-2: I strongly vote against any method involving SET DATEFIRST and/or DATEPART(dw)

    One of the (undesired?) side effects: once you have a specific SET DATEFIRST in your batch, any following SET...



    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: Data for the current week

    This is based on a week from Monday 12:00 AM to Sunday 11:59:59.999PM:

    SELECT

    FROM YourTable

    WHERE YourColumn > = DATEADD(wk,DATEDIFF(wk,0, GETDATE() -1 ),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: Sub-queries and grouping

    First you need to define what a week is (e.g. does it start on Sunday or Monday or any other day? Is it based on ISO week (52 or 53...



    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: temp

    Tara-1044200 (6/24/2011)


    Also my other question is , does the temp release space to OS after dropping huge temp tables or do we have to shrink or restart the service 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: Preserving data while moving from one web page to another

    Why would you create a table per user?

    Add a column where you store the information what Portal User (or whatever you define as a unique connection) the data belong to.

    But...



    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 inser a record from another table

    Sounds like an auditing task.

    Assuming you're using SS2K5 (as indicated by the forum you posted in), you might want to consider a trigger concept using the data from the internal...



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