Print Page | Close Window

SQL Server Numbers

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=14600
Printed Date: 01 April 2026 at 4:20am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Server Numbers
Posted By: Gullanian
Subject: SQL Server Numbers
Date Posted: 07 April 2005 at 12:48pm
Hi

I want to store numbers in my SQL Server database, how high can Int go?  Can you set an int to be unsigned as I only need to to be whole integers from 0 onwards.

I'm looking to store numbers anywhere from zero into the trillions.  I don't want to store it as a string and write my own add functions etc!  Numbers have to be accurate.

Thanks,

Tom



Replies:
Posted By: Mart
Date Posted: 07 April 2005 at 12:56pm
I don't think you can have unsigned integers the max field size for int is 12 so I assume the biggest number you can have is 999,999,999,999 not cetain though

EDIT: I think its 999,999,999 actually, as that is the highest value I can insert



Posted By: Gullanian
Date Posted: 07 April 2005 at 1:12pm
Rats that's only 1 billion.  I really need a lot more than that.  Is the only way to get past this to store it as a string and write my own functions to do math on them?  That's going to be a royal pain in the ass.


Posted By: michael
Date Posted: 07 April 2005 at 1:54pm
Int can hold a max of 2,147,483,647
BigInt can hold a max of 9,223,372,036,854,775,807
If you need to go higher, you approximate numbers like 'real' and 'float' which go to 3.40E + 38 respectively 1.79E + 308
 


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Gullanian
Date Posted: 07 April 2005 at 1:59pm
Thanks

I get mismatches when dealing with the bigints in ASP, what do I convert the bigint value from the database to?  Long?  Or is that not big enough.


Posted By: michael
Date Posted: 07 April 2005 at 2:14pm
no idea. asp too long ago. sorry

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: ljamal
Date Posted: 07 April 2005 at 4:57pm
You get errors if you try to do Integer math or BigInts via VBScript. IF you convert them to doubles via VBScript, then you should not have that problem.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Gullanian
Date Posted: 07 April 2005 at 8:07pm
Isn't double inaccurate though?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net