Forum Replies Created

Viewing 15 posts - 3,601 through 3,615 (of 5,502 total)

  • RE: Is it possible to crosstab xml column

    I assume you're familiar with shredding those data into a relational (temp) table using XQuery. If not, please post back and we'll show you an example how to do it.

    Once...



    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: Remove extra CR-LF from end of SELECT output to Text / File

    Lynn Pettis (5/3/2010)


    Precisely where I was going with this, but all three queries must have the same number of columns and data types (or nulls).

    ... and that's exactly the case...



    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: With Rollup

    Would you mind to share an example to support your argument?



    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: Remove extra CR-LF from end of SELECT output to Text / File

    The following code would solve the example you provided, but as Lynn already suggested, posting your code would probably help us help you with the "real issue"...;-)

    SELECT 'Header Record'

    UNION ALL...



    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: Remove extra CR-LF from end of SELECT output to Text / File

    It seems like you add the extra CR-LF within your trailer record statement. Hard to tell without actually seeing the code...

    Probably something like

    -- some code

    +'

    < trailer record > '

    ...



    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: FTS-Containstable-Ranks !

    black.clouds.999 (5/3/2010)


    Thanks Imu !

    Here is what I got from BOL :

    CONTAINSTABLE ranking uses the following algorithm:

    StatisticalWeight = Log2( ( 2 + IndexedRowCount ) / KeyRowCount )

    Rank = min( MaxQueryRank, HitCount...



    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: Create a table from another table for multiple values

    It's called CroosTab or Pivot.

    For a CrossTab solution please see the related link in my signature. It will shortly describe the PIVOT syntax as well.



    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: FTS-Containstable-Ranks !

    You actually search for an exact match of either the word "mountain" or "mounting". Therefore, you'll get two different result sets. You might want to search for "mount*".

    For details, please...



    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: Compare ranges of values of multiple rows in a single column

    kobyziv (5/2/2010)


    Yeh - I see what you mean

    Quite true, quite true...

    Tnx for the good eye.

    You're very welcome! 😀



    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: Compare ranges of values of multiple rows in a single column

    Assume the following scenario:

    You have a new room that's available since the hotel decided to refurniture the clothing store.

    This room will never be available since it doesn't show up 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: Compare ranges of values of multiple rows in a single column

    Change the SELECT clause to

    SELECT COUNT(DISTINCT t.room_id)

    FROM @tbl t

    LEFT OUTER JOIN cte_blocked b ON t.room_id=b.room_id

    WHERE b.room_id IS NULL



    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: Compare ranges of values of multiple rows in a single column

    First I would try to find the blocked rooms and second display the remaining:

    Side note: please notice how I posted the sample data o make it easier to work 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: Median

    What would be your expected result?



    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: If One COLUMN = 'N' SET ALL TO '0'

    I would use the "quirky update" (or 3-part-update):

    DECLARE @tbl TABLE

    (

    Region CHAR(10),Col1 CHAR(1), Col2 CHAR(1),Col3 CHAR(1)

    )

    INSERT INTO @tbl

    SELECT 'SOUTH','N','N','Y' UNION ALL

    SELECT 'SOUTH','Y','N','N'

    DECLARE @n CHAR(1)

    SET @n='0'

    UPDATE @tbl

    SET

    @n=col3=CASE WHEN @n='0' AND col3='N'...



    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?

    CirquedeSQLeil (4/30/2010)


    Odd question just occurred to me.

    Has anybody here ever tried setting their sa account password to contain emoticons? Or any sql logon password for that matter.

    sa password =...



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