Bigint As Unsigned Value? (MS SQL Server)

Posted on 2009-05-10
Medium Priority
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?
Question by:robertkc
LVL 143

Accepted Solution

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:
LVL 31

Expert Comment

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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

619 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