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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -