Forum Replies Created

Viewing 15 posts - 3,976 through 3,990 (of 5,502 total)

  • RE: Splitting A String

    Something like this?

    DECLARE @OutlineNumber VARCHAR(1000)

    SET @OutlineNumber= '.I.A.1.b.'

    SELECT STUFF(SUBSTRING(@OutlineNumber,1,CHARINDEX('.',@OutlineNumber,N+1)),1,1,'')

    FROM dbo.Tally

    WHERE N < LEN(@OutlineNumber)

    AND SUBSTRING(@OutlineNumber,N,1) = '.'

    The variable needs to have a dot...



    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: Counting # of Duplicate Records

    No need for further discussion.

    Seems like the question has already been answered here .

    Side note: since the solution in the other thread is based on ROW_NUMBER I guess 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: Counting # of Duplicate Records

    redrabbit9999 (3/15/2010)


    This works!!! Thanks. I have another question:

    Do you know how to pivot transform the data so that it looks like this:

    Unpivoted Data:

    Column1 Column2 Column3

    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: Importing XML Files Into SQL Server

    Glad I could help 😀

    And sorry for underestimating the performance improvement 😉



    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: Question on pivot tables

    Hi

    thanks for your informations but ALL TIMES I GET

    Msg 170, Level 15, State 1, Line 7

    Line 7: Incorrect syntax near 'PIVOT'.

    Message Dou you have any suggestion for me

    Duplicate post.

    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: PIVOT function

    muratistanbul (3/14/2010)


    Hi, When I use PIVOT function , ALL THE TIMES I GET

    Msg 170, Level 15, State 1, Line 7

    Line 7: Incorrect syntax near 'PIVOT'.

    Message is anybody have suggestion for...



    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?

    RBarryYoung (3/14/2010)


    Well, my back surgery is tomorrow (it got moved up). They've been putting me through medication withdrawal the last two weeks in preparation, so apologies if I've been...



    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: building a date

    I'd expect the problem is within the setting of your DATEFORMAT parameter.

    But the major problem is: you're trying to treat a date value as a string.

    If it's a date, use...



    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: Transposing repeating sets of rows into colums

    Ok, here's what I came up with. I'm not sure if it'll help but it might be at least something to start with.

    CREATE TABLE #temp

    (id INT IDENTITY(1,1),

    col VARCHAR(60) ...



    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?

    To any of you folks from "down under":

    Congrats for winning the Hockey World Championship in India!

    We didn't have that much of a chance in the final though...



    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?

    @paul-2: CONGRATULATION to be one of the top 25!



    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: Importing XML Files Into SQL Server

    The reason for the bad performance is you're 'climbing up' one level each time you select one of the values from the Circuit node. Try to use CROSS APPLY instead.

    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: Stored Procedure Problem Help!

    scott.atkins (3/13/2010)


    Hi Sorry for the late reply, thanks for the information much apreciated,

    Im just curious how would you write a CURSOR script though? Would some one be able 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: Temp tables

    Paul White (3/13/2010)


    GilaMonster (3/13/2010)


    The error has to do with parsing, the parser doesn't execute the code and sees the same table been created twice, hence the error.

    Lutz...:laugh:

    :blush:



    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: inserts are getting slower

    Adding to what Paul already said:

    your nonclustered index is unlikely to be used since it has the same leading column as your clustered index.

    Please explain what you think the indexes...



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