Forum Replies Created

Viewing 15 posts - 5,326 through 5,340 (of 5,685 total)

  • RE: Finding Sequences (Need help ASAP)

    These are my results with the null rows removed:

    Pattern GapStart GapEnd

    -------- -------------------- --------------------

    PPCI ...

  • RE: Finding Sequences (Need help ASAP)

    This will sound strange but... are you sure you have gaps?

    Run this code:

    CREATE TABLE #MidPoint

    (RowID INT,

    Pattern VARCHAR(100),

    Startnum BIGINT,

    EndNum BIGINT

    )

    INSERT INTO #Midpoint

    select

    ROW_NUMBER() OVER (ORDER BY

    left(controlnumber, PatIndex('%[0-9]%', controlnumber)-1),

    convert(int, SubString(controlnumber, PatIndex('%[0-9]%', controlnumber),...

  • RE: Finding Sequences (Need help ASAP)

    Found them, the sample rows:

    2048205PPCI000737005NULL

    2048206PPCI000737009NULL

    2048207PPCI000999798NULL

    2048208PPCI001346238NULL

    2048209PPCI001350958NULL

    2048210PPCI001462905NULL

    2048211PPCI001620877NULL

    2048212PPCI001620882NULL

    2048213PPCI001620891NULL

    2048214PPCI001620899NULL

    2048215PPCI001620909NULL

    2048216PPCI001620957NULL

    2048217PPCI001620962NULL

    They appear to be single page docs. Is this expected in the data?

  • RE: Finding Sequences (Need help ASAP)

    craig-404139 (10/8/2010)


    CSV file attached.

    First column = id

    Second column = controlnumber

    Third column = endno

    That worked. Alright, so we're looking at taking two unique values, figuring out the 'fill', and splitting...

  • RE: Are the posted questions getting worse?

    Alvin Ramard (10/8/2010)


    Brandie Tarvin (10/8/2010)


    Ray K (10/8/2010)


    Gianluca Sartori (10/8/2010)


    At last, Mr. Celko gives a polite and useful answer to a poor-worded question.

    It's nice to see everyone can learn.

    I don't know....

  • RE: Finding Sequences (Need help ASAP)

    I had assumed, since 2k5 and 2k don't behave, but figured it was worth the question. I'm sure Wayne and the others will be able to get you a...

  • RE: Finding Sequences (Need help ASAP)

    craig-404139 (10/8/2010)


    Updated the zip. Changed the compatibility to 90, added a pk column, and truncated the old large log (sorry i forgot the first time)

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

    It would appear the internal version...

  • RE: Finding Sequences (Need help ASAP)

    craig-404139 (10/8/2010)


    Sure. I was also thinking would this be easier if I added a PK to the table? Both of these columns are just data columns in my production system.

    Without...

  • RE: SQL job error, urgent!!!

    Mh-397891 (10/8/2010)


    Description: The connection type "SMTP" specified for connection manager "SMTP" is not recognized as a valid connection manager type.

    Stripped it down to what I think is critical to...

  • RE: Finding Sequences (Need help ASAP)

    craig-404139 (10/8/2010)


    Craig Farrell (10/8/2010)


    Sorry guys, came down with a case of the plague yesterday, didn't mean to abandon the topic. Was looking through the code and Craig-4 (we're gonna...

  • RE: Finding Sequences (Need help ASAP)

    Sorry guys, came down with a case of the plague yesterday, didn't mean to abandon the topic. Was looking through Wayne's code and Craig-4 (we're gonna need to do...

  • RE: DeadLock

    WayneS (10/6/2010)


    Research links, no. But I've seen deadlocks caused by parallelism before myself... so self-research - yes.

    Well, in that case, Amit, try a MAXDOP 1 and see if that helps...

  • RE: Finding Sequences (Need help ASAP)

    WayneS (10/6/2010)


    craig-404139 (10/6/2010)


    Question: when a prefix changes, do the numbers restart at 1? Or do they continue?

    (I've got some real nifty, high-speed code (thanks to Jeff!) to quickly identify gaps...

  • RE: How to construct set-based update stmts

    Merge command is handy because it's basically used as an 'upsert', an insert/update.

    First, you'd do your deletes separate.

    The MERGE would then insert and update simultaneously according to your key. ...

  • RE: Finding Sequences (Need help ASAP)

    And for my last trick...

    This ran in about 3:15 on my system

    -- First, separate the numbers and their prefixes into usable data.

    select

    TextID,

    LEFT( TextID, MAX( N) ) AS Pattern,

    CAST(...

Viewing 15 posts - 5,326 through 5,340 (of 5,685 total)