Bind a column default value to a function in SQL 2005

后端 未结 3 488
青春惊慌失措
青春惊慌失措 2020-12-06 16:51

I have a column containing items that can be sorted by the user:

DOC_ID  DOC_Order DOC_Name
   1       1        aaa
   2       3        bbb
   3       2              


        
3条回答
  •  臣服心动
    2020-12-06 17:41

    Here's screen shots to do it through SQL Server Management Studio GUI:

    1. Right click on table and select Design

    1. Select DOC_Order column (or other column needing default) in the table's design view to see properties

    1. Update Default Value or Binding with function name with brackets like so:

    Note: as Luk stated, all brackets are needed including the schema (dbo in this case).

提交回复
热议问题