Forum Replies Created

Viewing 15 posts - 4,471 through 4,485 (of 5,502 total)

  • RE: Find different values for related orders?

    First of all: thank you for providing ready to use test data!! Well done! 😀

    Would something like the following help?

    ;WITH cte AS

    (

    SELECT RelatedID

    FROM #A

    GROUP BY RelatedID

    HAVING count(DISTINCT...



    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: Sorting Stored Procedures???

    bgeige (1/19/2010)


    SSMS/View/Object Explorer Details/Procedures

    How would you sort the procs by creation date, as requested in the original post? :ermm:



    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: Best approach - XQuery Vs sp_xml_preparedocument

    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: cursor performance

    Based on what you provided so far the cursor could be elminated by a single insert statement like this:

    INSERT INTO XMLtemppatientMap(oldpatientID, newpatientID, oldfileID, newfileID)

    SELECT patientID,'@newpatientID',fileID,NEWID()

    FROM fileList

    WHERE patientID = @patientID

    AND (fileType...



    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: Best approach - XQuery Vs sp_xml_preparedocument

    I think the major issue is that you use the CROSS APPLY function in a way that forces SQL server to parse the xml string for each and every article.

    I'd...



    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 top 1 accross a whole set

    When adding the following three samples to your data, which one should be displayed (each one has values in two out of three columns)?

    select 'fred', 'unsure', 33716, 'test@here.com','444.75.224.23', null

    union

    select 'fred',...



    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 Create a Temp table with Incr dates for each day

    I wouldn't really use a while loop for it nor would I order by ordinal column position.

    I'd rather go with a set based solution based on the Tally table concept...



    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: Working with Dates

    Would the following work (untested)?

    CASE WHEN [DOB] = '1899-12-30 00:00:00.000' THEN NULL ELSE [DOB] 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: Update Trigger to change fields in four tables

    It sounds like your database structure is far away from being normalized...

    Instead of looking for a way to update those 4 tables I strongly recommend to redesign your database 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: The data types varchar and nvarchar are incompatible in the modulo operator

    The percentage sign is misplaced. Therefore it's treated like

    SELECT @Query%

    Try

    AND sdest.[text] LIKE ''%' + @Query +'%''



    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: Column and Row Total

    I'd talk to the folks that are responsible for the script that adds the column each day to give me another column [row_total] that would add all previous columns. If...



    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 Subqueries and Joins - Retrieving columns from multiple tables without using table variables/temp tables

    I'd like to repeat what I stated before:

    Please provide table definition, sample data (in a ready to use format) and expected output as described in the first link in my...



    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: Calculation of points

    Since you already started using "left" and "right" terms in your table you might want to consider using those columns as holding the data as per the nested set model....



    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: Calculation of points

    What is the business rule for the values for Introducer,LeftMember, and RightMember?

    Yor sample do not show an "easy" pattern...

    Example: ID=2 has Introducer=10 but is LeftMember of ID=1.

    Edit: Thank 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: Calculation of points

    Several issues:

    1) please provide sample data in a ready to use format

    2) include expected result set

    3) show us what you've tried so far and where you get stuck

    For details reagarding...



    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 - 4,471 through 4,485 (of 5,502 total)