table help

  • How can i alter this Test table for the column to default value 0 instead NULL.

    here is the table

    Test

    cusid folat  Null  --> need to change this to default 0

    amount real  NULL  --> need to change this to default 0

    Thanks

  • ALTER TABLE [dbo].[Test]

    ADD CONSTRAINT [DF_dbo_Test_amount] DEFAULT 0 FOR [amount]

  • Here you need to take note of one additional Information.

    If table is populated with Rows then

    Add Constraint is not going to change the null data

    values from the previously populated rows.

     

     

     

     

     

    Kindest Regards,

    Sameer Raval [Sql Server DBA]
    Geico Insurance
    RavalSameer@hotmail.com

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply