Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6071937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:06:16+00:00 2026-05-23T10:06:16+00:00

I have faced a thing as NEWID(). I thought it should be useful as

  • 0

I have faced a thing as NEWID(). I thought it should be useful as to insert INT key id-s values to a table, but it returns float or something which is not pretty good for ID column value. So my question is how to get auto generated INT ID value for table insert?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:06:16+00:00Added an answer on May 23, 2026 at 10:06 am

    You define a column of type INT (or SMALLINT, TINYINT, BIGINT) with the IDENTITY attribute:

    CREATE TABLE dbo.YourTable( ID INT IDENTITY(1,1) ......
    

    With this setup, SQL Server will automatically generate consecutive ID’s for your table when rows are being inserted into your table.

    With a type INT, starting at 1, you get over 2 billion possible rows – that should be more than sufficient for the vast majority of cases. With BIGINT, you get roughly 922 quadrillion (922 with 15 zeros – 922’000 billions) – enough for you??

    If you use an INT IDENTITY starting at 1, and you insert a row every second, you need 66.5
    years before you hit the 2 billion limit ….

    If you use a BIGINT IDENTITY starting at 1, and you insert one thousand rows every second, you need a mind-boggling 292 million years before you hit the 922 quadrillion limit ….

    Read more about it (with all the options there are) in the MSDN Books Online.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have designed a custom section handler before but I'm faced with a problem
Our team is faced with slow but serious Javascript memory leak . We have
Whenever we have to update the database; we delete the values from the table
I faced an interesting problem as... I have MSSQL (2005) table A which contains
From the moment I have faced Python, the only thing I can say for
This is the most annoying thing i have faced in webforms development. I have
I have faced a problem in Qt with error: cannot convert parameter 1 from
I have faced the same problem many times. The Same Problem was With This
I am trying to make a Facebook login in my website, I have faced
I have a problem that I have not faced before: It seems that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.