Nate Pet
Nate Pet

Reputation: 46322

SQL Server Default field value

In SQL Server, I have a field which is a bit. I need to default it to 0 on insert of a new record. I thought there was a way for SQL Server to automatically create a constraint without writing code. I thought there was a way to right click on the field and go to properties. I tried but do not see how to default a field.

Upvotes: 1

Views: 131

Answers (1)

Sam Axe
Sam Axe

Reputation: 33738

SQL Server Management Studio: Select the table from the tree, context menu, design table, select the field, in the properties grid at the bottom type a zero (0) in the Default row, save.

Upvotes: 4

Related Questions