Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
max value for int data type in Microsoft sql server is
-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807). is there any data type for which there is no max value ? i need to define the primary key of that data type.i think one solution id GUID but i do not know how to get the particular GUID say if it EmployeeId as primary key .What to do?
Posted
Comments
[no name] 17-Oct-14 18:53pm    
SELECT yourData FROM Emplyees WHERE EmployeeId = someGUID
But use parameterized queries.
Herman<T>.Instance 21-Oct-14 10:23am    
Why you think you do not have enough id's in the LONG range?
Abeeeeeeeeeeeeeeeeee 21-Oct-14 15:46pm    
I dont want to maintain the database , in case the id's are exhausted.plz i need the solution , a solid one

Do not exhaust your brain for useless thoughts! An employee is a human being, isn't he? How many people are there on earth? The max number of that datatype is more than a 1000million times bigger.
 
Share this answer
 
Comments
Maciej Los 23-Oct-14 2:34am    
Good point!
+5
Bernhard Hiller 23-Oct-14 4:36am    
Thanks.
here you may not get the solution, but definately you'll get some thoughts..

#Here[^]
 
Share this answer
 
Comments
Maciej Los 23-Oct-14 1:34am    
How this answer is related to the question?
My vote of 1.
There is several data types[^] and each type has its limitation (in a simple manner).
I'd suggest to use GUID, as is described here: NEWSEQUENTIALID[^] and here: UNIQUEIDNETIFIER[^]. Please, read all notes.

Sample[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900