I have a table called tblOrderNumber which has 1 row and 1 column. This table stores what the next order number will be for my ecommerce website. It is ABSOLUTELY VITAL that the same order number is not used more than once. Currently the team are using this stored procedure and it seems to work fine:
My question is does UPDLOCK guarantee this? I would have thought a Read Lock is required on the SELECT too (in the unlikely case …
我有一个当前看起来像这样的数据库表:
PageField
-Id (Int, PK)
-FieldType (String) Can be Text, Decimal, Integer or Bit
-Value (This stores the value regardless of the FieldType, so it is not strongly typed)
Run Code Online (Sandbox Code Playgroud)
我是否应该删除Value列并将其替换为 4 个单独的列TextValue、DecimalValue、IntegerValue和BitValue吗?
数据类型将设置为相关内容。这意味着在这 4 列的每一行中,第 3 列将是NULL
.