Solved

Bigint As Unsigned Value? (MS SQL Server)

Posted on 2009-05-10
2
1,999 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
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

830 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