开发者

Can anyone explain how this constraint functions?

开发者 https://www.devze.com 2023-01-17 11:08 出处:网络
Can anyone explain how开发者_如何学Python this constraint functions and how its affects insertion of records into this table? Running win sql 2k5. Having issue with trying to insert data.

Can anyone explain how开发者_如何学Python this constraint functions and how its affects insertion of records into this table? Running win sql 2k5. Having issue with trying to insert data.

  ALTER TABLE [dbo].[ws_shiptable] ADD  CONSTRAINT [DF_ws_shiptable_ps_processed]  DEFAULT (0) FOR [ps_processed]


It adds a default value of 0 for column ps_processed. If you do an insert and you don't specify a value for ps_processed, it'll default to 0. What is the issue you are having? Do you get error messages you can post? A default value shouldn't give you trouble, but make sure ps_processed has the right data type. I suspect it'll be a bit field?


If no value is provided for the column ps_processed then SQL Server will set the value to zero

0

精彩评论

暂无评论...
验证码 换一张
取 消