Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 5th, 2005, 01:20 AM
jonpanky jonpanky is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, UK
Posts: 137 jonpanky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 3 h 3 m 4 sec
Reputation Power: 4
Send a message via MSN to jonpanky
Question Int?

Hello, this might seem like a really basic question but hopefully someone can answer it for me.

I have a tbl.photographs with several columns the first one is pictureID the type is INT and I use it as the primary key. it says 0-9999 now I'm wondering what happens when I get to 9999 is that it? or does it keep on going? I'm a bit worried should I change the type?

Regards
Jon

Reply With Quote
  #2  
Old January 5th, 2005, 03:07 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 28 m 48 sec
Reputation Power: 180
int will count up to a very large number, way above 9999 anyway
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old January 5th, 2005, 03:40 AM
jonpanky jonpanky is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, UK
Posts: 137 jonpanky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 3 h 3 m 4 sec
Reputation Power: 4
Send a message via MSN to jonpanky
Question

oh ok, so INT 0-9999 will go further then? I'm just worried if the insert will stop working when I get to pictureID 9999... will it go to 10,000 or blow up !

Reply With Quote
  #4  
Old January 5th, 2005, 10:27 AM
A2k's Avatar
A2k A2k is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 166 A2k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 44 m 10 sec
Reputation Power: 4
it definatly won't blow up, but if it does don't blame me...

Reply With Quote
  #5  
Old January 5th, 2005, 10:34 AM
jonpanky jonpanky is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, UK
Posts: 137 jonpanky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 3 h 3 m 4 sec
Reputation Power: 4
Send a message via MSN to jonpanky
Fingers crossed then I'm up to 8.5k in one table now.... I have been told on another forum that DOUBLE is a better solution, is that right?

Jon

Reply With Quote
  #6  
Old January 5th, 2005, 10:53 AM
A2k's Avatar
A2k A2k is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 166 A2k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 44 m 10 sec
Reputation Power: 4
yeah, thats right,

In old money an int was 32768(?)bits/bytes(I cant remember which...) which gives you a big number! and a double is 65536(?)bits( again can't remember!), I'm not sure if thats the same with SQL server2000, and in modern programming languages the int is a very big number that you'll probably never need, and thats the technical term for it!

And no Microsoft doesn't employ me with my dodgy memory for bytes/bits! They're capable of making informed buffer over runs!

Reply With Quote
  #7  
Old January 6th, 2005, 07:45 AM
Dumbo Dumbo is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 29 Dumbo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 27 m 31 sec
Reputation Power: 0
Double? this sounds like you are using MS Access, in wich case I would change to Long Integer.

Reply With Quote
  #8  
Old January 6th, 2005, 08:23 AM
jonpanky jonpanky is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, UK
Posts: 137 jonpanky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 3 h 3 m 4 sec
Reputation Power: 4
Send a message via MSN to jonpanky
Sorry I read the manual INT is fine, I was getting confused with 'length' being 4 I thought that meant digits... no it's SQL

Reply With Quote
  #9  
Old January 6th, 2005, 07:22 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 28 m 48 sec
Reputation Power: 180
Quote:
Originally Posted by jonpanky
Sorry I read the manual INT is fine, I was getting confused with 'length' being 4 I thought that meant digits... no it's SQL

Yes, that 4 means it takes 4 bytes of internal storage, or 32 bits, which counts up into the millions or billions range.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Int?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway