sql server 2008 - Add a column value from another table as default constraint -
sql server 2008 - Add a column value from another table as default constraint -
how add together default constraint table such value used default table's columns?
i have created table my_tbl
in having column currency_cd
references currency_cd
column of table currency
. want set my_tbl.currency_cd
default value coming currency
table.how can accomplish this?
you can add together function retrieve default table, this:
alter table [dbo].[yourtable] add together constraint [df_yourtable_col1] default ([dbo].[yourfunction]()) [col1]
sql-server-2008 tsql
Comments
Post a Comment