Unsigned data type.
-
Is there possibility to define unsigned type or convert already exist type, int for example, to unsigned int in MSSQL?
-
Can you be more clear in your question?
I Love T-SQL "Don't torture yourself,let the life to do it for you."
-
Is there possibility to define unsigned type or convert already exist type, int for example, to unsigned int in MSSQL?
There is no unsigned integer types in SQL Server, except for tinyint (0 - 255). You can use an user defined data type, but that will not make the size of the data smaller (which is what I'm assuming you want to do). You can also add a constraint to a column so the value is >= 0. As for saving space, no way to unsign an int.
-
Is there possibility to define unsigned type or convert already exist type, int for example, to unsigned int in MSSQL?
There are no unsigned integers in SQL Server, except for tinyint. So for bigger values define a INT or BIGINT data type ( as per your database demand ) and add a check contraint to accept only positive values. Like the below example. create table x_table(i int, j_Pos_value int constraint chk_j _cons Check (j_Pos_value>=0)) :-O
"We can't solve problems by using the same kind of thinking we used when we created them"