?
Solved

Bigint As Unsigned Value? (MS SQL Server)

Posted on 2009-05-10
2
Medium Priority
?
2,074 Views
Last Modified: 2012-05-06
If I want to store an unsigned value how do I go about it?

In mysql it can be done, but in ms sql, how?
0
Comment
Question by:robertkc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24349314
you put a bigint, and set a check contraint to allow only values >= 0 .
see here:
http://www.julian-kuiters.id.au/article.php/sqlserver2005-unsigned-integer
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24351266
there is no default data type to do it in SQL Server, can you please let us know your goal, we may show you some other way of doing it? Otherwise the solution above is fine, create user defined data type and put a check constraint
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question