我讀過,SQL Server有能力創建一個無符號的整數列,我還讀到SQL Server不允許創建整數無符號列。所以我很困惑,哪一個實際上是正確的。Postive整數和無符號在SQL Server 2012
我需要在我的表中創建一個名爲QuantityonHand的新列。此欄應該是5個字符的整數,並且只能接受正數。
所以我創建列作爲;
(1) QuantityonHand [unsigned] int (5) which means the number can only be positive OR
(2) QuantityonHand int (5) default 0 - which means the number cannot be less than zero, the default 0 being the condition in the column.
我傾向於第二個,但我希望得到一些指導之前,我添加列和弄亂我的表。
謝謝大家 喬西
@Josie通過'這一欄應該是5個字符的整數,只接受積極numbers.'你的意思是高達99999或5個字符的整數? – lad2025
@ lad2025 .....謝謝你們兩個,這是我做的添加列作爲int與檢查約束大於零。 – Josie
@JamesZ .....謝謝你,這就是我所做的,添加了一個int列,檢查約束> 0 – Josie