Forum Replies Created

Viewing 15 posts - 4,411 through 4,425 (of 5,502 total)

  • RE: Collation problem! dont know what to do :(

    If you compare two character fields and you run into the collation conflict you can change the collation inside the query:

    SELECT [object_id]

    FROM report_objects

    WHERE report_id = @report_id

    AND...



    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 not covering ALL possibilities -- Need help fixing issues regarding a few out liers

    How about the following code?

    It is based on the assumption that, if there is another blank character after the one that follows the direction separator [dpos], then dpos is a...



    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: Please solve this sql query

    Going back to your very first post:

    anshu84onnet (1/26/2010)


    i am writing this query--' Select 8 from table' and this is returning number of rows present in table times 8 as output...



    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: convert NULL to 0 in Pivot Result Set

    RHaverty 8478 (1/27/2010)


    This is a function I use to return 0.00 for a null value. The use is

    Declare Amt Decimal(10,2)

    Select Amt = dbo.ConvertNullToZero(DbAmtVal)

    ...



    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: grouping my result set based on the firstname column with all other columns included

    If you want all the other columns to be in there as well, how would your expected output look like?

    Either you have one row per firstName then you'd have 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: Please solve this sql query

    @ Lynn:

    I'd experct the second query to be SELECT * instead of another SELECT 8...



    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: convert NULL to 0 in Pivot Result Set

    Glad it finally worked out! 🙂

    Did you notice how fast you had a tested solution once you provided ready to use data? 😉

    I see you use the varchar(8000) instead 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: T-SQL --> XML; dealing with non-ASCII chars

    Without table definition and sample data provided as per the first link in my signature we can't really help you.

    When I asked for an example I was talking about 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: convert NULL to 0 in Pivot Result Set

    Now that we have ready to use data it becomes really easy:

    You have to use a dynamic SELECT statement using the ISNULL function inside your dynamic sql statement:

    ...



    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: convert NULL to 0 in Pivot Result Set

    Please provide all related table definition together with sample data and expected result in a ready to use format.

    The query you provided won't run due to missing tables and columns.



    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: Looking the best way to storing NOT NULL in table

    I don't think there will be a "best practice" answer...

    It's more like one for the "it depends" category... But I might be wrong.

    I, personally would use the first option 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: T-SQL --> XML; dealing with non-ASCII chars

    Would you mind sharing an example so we have something to play with?



    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: convert NULL to 0 in Pivot Result Set

    You have to apply the ISNULL() function to your outer SELECT statement. That means you cannot use a SELECT *.

    Unfortunately, your sample data and your query don't match (columns [Columns]...



    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: Generating XML

    Glad you found it as useful as I did!

    If you have any specific questions let us know and we'll try to find an answer 😉



    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 multiple descriptions from single field of codes

    Since the multi valued column is char(10), there can be a maximum of three values (btw: I'd rather use a char(9) length...).

    Instead of calling the function I'd probably do it...



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