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. Identity in a field

Identity in a field

Scheduled Pinned Locked Moved Database
question
7 Posts 4 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.
  • M Offline
    M Offline
    M J Jaya Chitra
    wrote on last edited by
    #1

    Dear All, I have a question regarding the usage of IDENTITY. Can any one answer me? My Question is: Whenever the primary key field is having an auto generated value i.e. IDENTITY. If any overflow occurs i.e. when the fields reaches its maximum value, what will happen? Thanks in advance.

    Best Regards, M. J. Jaya Chitra

    K 1 Reply Last reply
    0
    • M M J Jaya Chitra

      Dear All, I have a question regarding the usage of IDENTITY. Can any one answer me? My Question is: Whenever the primary key field is having an auto generated value i.e. IDENTITY. If any overflow occurs i.e. when the fields reaches its maximum value, what will happen? Thanks in advance.

      Best Regards, M. J. Jaya Chitra

      K Offline
      K Offline
      KANGAROO_
      wrote on last edited by
      #2

      obviously it will generate an error......... :)

      manoj Kumar Jha "Learn to smile at every situation. See it as an opportunity to prove your strength and ability."

      M 1 Reply Last reply
      0
      • K KANGAROO_

        obviously it will generate an error......... :)

        manoj Kumar Jha "Learn to smile at every situation. See it as an opportunity to prove your strength and ability."

        M Offline
        M Offline
        M J Jaya Chitra
        wrote on last edited by
        #3

        Practically, how can be get rid of this error?

        Best Regards, M. J. Jaya Chitra

        D 1 Reply Last reply
        0
        • M M J Jaya Chitra

          Practically, how can be get rid of this error?

          Best Regards, M. J. Jaya Chitra

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Change the datatype of the ID field to one that holds values bigger than the one you have now.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Change the datatype of the ID field to one that holds values bigger than the one you have now.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            M Offline
            M Offline
            M J Jaya Chitra
            wrote on last edited by
            #5

            Already my data type is big int. My application is going to store voluminous transactions in the database.

            Best Regards, M. J. Jaya Chitra

            V D 2 Replies Last reply
            0
            • M M J Jaya Chitra

              Already my data type is big int. My application is going to store voluminous transactions in the database.

              Best Regards, M. J. Jaya Chitra

              V Offline
              V Offline
              vimal_yet
              wrote on last edited by
              #6

              Then use GUID in SQL Server. by using the function newid()

              If U Get Errors U Will Learn If U Don't Get Errors U Have Learnt

              1 Reply Last reply
              0
              • M M J Jaya Chitra

                Already my data type is big int. My application is going to store voluminous transactions in the database.

                Best Regards, M. J. Jaya Chitra

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                BigInt and you think you're going to run out of IDs?? You can't possibly tell me that your table is going to hold more than 9,223,372,036,854,775,807 (time 2 for negative numbers) records. I'd like to see the storage drive array that's going to hold this database, not to mention the backup scheme you've got.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                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