Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Start records from Specific Number

Start records from Specific Number

Scheduled Pinned Locked Moved Database
databasequestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gandalf_TheWhite
    wrote on last edited by
    #1

    Hi all, I want to start to enter my records from specific number. let's say I would like to start entry in database table from 1000 instead of 1. means right now my records are entered in database from 1. Instead of 1 I would like it to start from 1001. Is it possible? if yes then how?

    Believe Yourself™

    A L 2 Replies Last reply
    0
    • G Gandalf_TheWhite

      Hi all, I want to start to enter my records from specific number. let's say I would like to start entry in database table from 1000 instead of 1. means right now my records are entered in database from 1. Instead of 1 I would like it to start from 1001. Is it possible? if yes then how?

      Believe Yourself™

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      Try This :

      DBCC CHECKIDENT (tableName, RESEED, 1000)

      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

      G 1 Reply Last reply
      0
      • G Gandalf_TheWhite

        Hi all, I want to start to enter my records from specific number. let's say I would like to start entry in database table from 1000 instead of 1. means right now my records are entered in database from 1. Instead of 1 I would like it to start from 1001. Is it possible? if yes then how?

        Believe Yourself™

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Make your question as clear as possible, so others can understand it properly. What you are referring to is probably start an identity column in a table. When creating the column, you can specify the seed and the increment.

        CREATE TABLE Tab1
        (
        Col1 int IDENTITY (1000, 1)
        )

        If you want to change the seed of an existing column that may already have data, use this:

        DBCC CHECKIDENT ("Tab1", RESEED, 1000);

        G 1 Reply Last reply
        0
        • A Abhijit Jana

          Try This :

          DBCC CHECKIDENT (tableName, RESEED, 1000)

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

          G Offline
          G Offline
          Gandalf_TheWhite
          wrote on last edited by
          #4

          That worked!! Thanks Abhijit :thumbsup:

          Believe Yourself™

          A 1 Reply Last reply
          0
          • L Lost User

            Make your question as clear as possible, so others can understand it properly. What you are referring to is probably start an identity column in a table. When creating the column, you can specify the seed and the increment.

            CREATE TABLE Tab1
            (
            Col1 int IDENTITY (1000, 1)
            )

            If you want to change the seed of an existing column that may already have data, use this:

            DBCC CHECKIDENT ("Tab1", RESEED, 1000);

            G Offline
            G Offline
            Gandalf_TheWhite
            wrote on last edited by
            #5

            Both worked. Thanks. :thumbsup: Actually I am going to start it from 300000. Does this huge starting number could create any issue when the records increases?? If there would be any limitation for increasing the amount of the records in future then also please mention. :thumbsup:

            Believe Yourself™

            L 1 Reply Last reply
            0
            • G Gandalf_TheWhite

              That worked!! Thanks Abhijit :thumbsup:

              Believe Yourself™

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              Great ! ;)

              Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

              1 Reply Last reply
              0
              • G Gandalf_TheWhite

                Both worked. Thanks. :thumbsup: Actually I am going to start it from 300000. Does this huge starting number could create any issue when the records increases?? If there would be any limitation for increasing the amount of the records in future then also please mention. :thumbsup:

                Believe Yourself™

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                There is no known problem with using IDENTITY columns. It works well. If you want to really have 'big' numbers, use bigint datatype instead of int. The syntax remains the same.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups