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
精彩评论