Forum Replies Created

Viewing 15 posts - 496 through 510 (of 560 total)

  • RE: how to detect locking in t-sql

    If you are rebuilding your Indexes, MS-SQL requires a lock on that page, no matter what. Even using Enteprise edition, it will temporary acquire a shared lock, between processing.

    I recommend...

  • RE: identity seed

    Jeff Moden (10/3/2012)


    sql-lover (10/3/2012)


    sqlfriends (10/3/2012)


    Thanks,

    but I mean the starting seed number, I mean in order for it start again from 5000 in a table that already have records,...

  • RE: identity seed

    sqlfriends (10/3/2012)


    Thanks,

    but I mean the starting seed number, I mean in order for it start again from 5000 in a table that already have records, it seems I...

  • RE: identity seed

    I can be wrong, but if you want to start from where you left, different table, you must use SET IDENTITY INSERT ON ... insert, then turned it off. That...

  • RE: Running out of Identity values

    Jeff Moden (10/3/2012)


    So.... no interest in trying the 65 millisecond method I proposed to see if it'll work? 😉

    Took a less elegant approach 🙂 ... and I may use bt's...

  • RE: Running out of Identity values

    bteraberry (10/3/2012)


    Wow, they built a billion record heap? Ouch. Sorry man.

    I've seen a few similar tables. I am in the process of fixing those issues.

    Anyway ... tested your...

  • RE: Running out of Identity values

    I wanna die ... :crying:

    I just discovered there is no CI on that table, just a NCI. So bt ... your script is doing an ugly table scan (checked the...

  • RE: Running out of Identity values

    bt,

    That's a very nice piece of code, thank you so much. However, I wonder how many locks (if one) it will create. Like I said, the production server has serious...

  • RE: Running out of Identity values

    Michael,

    Good catch!

    Here's the simple schema...

    CREATE TABLE [dbo].[MyTargetTable](

    [col1] [bigint] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,

    [col2] [int] NOT NULL,

    [col3] [smallint] NOT NULL,

    [col4] [smalldatetime] NOT NULL,

    [col5] [real] NULL

    ) ON [FG2]

    col1 is INT on...

  • RE: Running out of Identity values

    Faced 1st challenge (dumb error)

    I can't use "n" option with BCP or re-inserted from source table. Source has "int" on that column. Target table already has the new "bigint" data...

  • RE: Running out of Identity values

    aaron.reese (10/3/2012)


    another thing, if you are going to create a new table and manually insert the records into it, dont forget to turn identity insert on; otherwise you will potentially...

  • RE: Running out of Identity values

    bteraberry (10/2/2012)


    Depending on your timeline, you could do this with virtually zero downtime. Rather than doing a bulk copy, you could easily chunk this up since you're not looking...

  • RE: Running out of Identity values

    bteraberry (10/2/2012)


    ScottPletcher (10/2/2012)


    Maybe I'm missing something.

    Why not just ALTER the column to be a bigint instead of an int?

    He said these are very big tables. Altering the column means...

  • RE: Running out of Identity values

    ScottPletcher (10/2/2012)


    Maybe I'm missing something.

    Why not just ALTER the column to be a bigint instead of an int?

    NO way! Because downtime! Why do you think that I am taking all...

  • RE: Running out of Identity values

    bteraberry (10/2/2012)


    Are the records in the tables in question ever updated or just inserted?

    Good point...

    Ever increased ... it is my understanding, no updates or inserts in the middle ...

Viewing 15 posts - 496 through 510 (of 560 total)