Forum Replies Created

Viewing 15 posts - 3,406 through 3,420 (of 5,502 total)

  • RE: change to 12 hour time format

    How about using CONVERT?

    SELECT RIGHT(CONVERT(CHAR(19),GETDATE(),100),7)



    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: Find Missing Number in a Sequence of numbers

    Why don't you use a Tally (or Numbers) table using a left join, limited to max(SortOrder)? If you don't use a Tally table yet, please have a look at the...



    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: store table data in xmlfile

    Please provide ready to use sample data and your requested result based on those data.

    Alternatively you could look into bcp for exporting data together with FOR XML (PATH/AUTO/RAW/EXPLICIT) to transform...



    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 convert datatable to xml

    duplicate post.

    A more detailed explanation can be found here.



    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: Xquery on XML column

    I took your sample file and removed a few lines to demonstrate the concept and to reduce the reply post. Both, XML NAMESPACES and CROSS APPLY are described in more...



    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 your opinion on Outsourcing?

    I think there is a misinterpretation between outsourcing and offshore outsourcing.

    Example: IT staff can be outsourced to another company that is located right next door (or even in-house). We...



    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 different rows different criteria same table

    Would you mind telling me why the code I provided a few posts back won't work for you? Still unknown 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: @list in IN Clause: How ?

    Thinking about it, you probably can avoid the dynamic SQL part if you'd replace your variable with the underlying subselect (again, untested):

    SELECT

    A.LoweredEmail,

    D.RoleName

    FROM dbo.aspnet_Membership AS A WITH (NOLOCK)

    INNER JOIN...



    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: @list in IN Clause: How ?

    AFAIK, the only way to get this to work is to use dynamic SQL (code snippet untested...).

    DECLARE @sql NVARCHAR(4000)

    SET @sql='

    SELECT

    A.LoweredEmail,

    D.RoleName

    FROM dbo.aspnet_Membership AS A WITH (NOLOCK)

    INNER JOIN dbo.aspnet_Users AS...



    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 different rows different criteria same table

    raafi.shaafi (5/27/2010)


    The only Input I have is Column1.

    Then you'd need to use the value of Column2 as a fixed value, since there is no other way to exclude Column0(0). 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: query that returns mutliple rows into one row

    The following two threads might help you to understand the usage of FOR XML as well as STUFF:

    http://www.sqlservercentral.com/Forums/FindPost679589.aspx

    and

    http://www.sqlservercentral.com/Forums/FindPost873866.aspx

    The former has some sample code that should help you understand the...



    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 different rows different criteria same table

    SELECT * FROM YourTable

    WHERE Column1 <> 'abc' OR (Column1 = 'abc' AND Column2='U')

    or

    SELECT * FROM YourTable

    EXCEPT

    SELECT * FROM YourTable

    WHERE Column1 = 'abc' AND Column2<>'U'



    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 that returns mutliple rows into one row

    If you want to get your results in one column rather than pivoted you could use the FOR XML "trick":

    SELECT

    ID, NAME,

    STUFF((SELECT ', ' + Orders FROM YourTable t2 WHERE t2.ID...



    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: Selects Within Selects

    What is that UPPER(user_ID) good for that is used so heavily within your query?

    If it's an integer you actually force it to an implicit conversion into an character value just...



    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 XML from table

    As usual, "it depends".

    If you have large XML data stored in that column it'll take a while to get the data due to the sheer volume.

    The question would be: What...



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