Solved

Bigint As Unsigned Value? (MS SQL Server)

Posted on 2009-05-10
2
1,989 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 142

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

776 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