Is it possible to set column property "Default Value or Binding" to an another column of the table?
- Moved by Tom PhillipsModerator Tuesday, March 09, 2010 2:24 PM Possibly better answer from TSQL forum (From:SQL Server Database Engine)
This can be done as below
DEFAULT N'default value' FOR column name
Check in BOL
Hope this help
Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.
Maybe i have explained incorrect.
In this case
Create Table Test
ColumnName int identity ,
DefaultValuedateColumn datetime default getdate() , - is default value = getdate() - 1
Defaultvalueintcolumn int default 100 , - is default value 100 - 2
DefaultBinColumn as Defaultvalueintcolumn - is computed column - 3
But i need another property:
There is a table Table1.
There are 2 columns in the Table1:
Column2 - if the user leaves the column blank, Value of the Column1 will be inserted into the column; but it is not computed column because the user are able to change the value in the Column2 independent of the Column1
Another way is to create a insert & update trigger for your table, if you have checked the null value in column2, you can assign it with the value in column2.
Besides, you mentioned SSIS, is the tables imported from another table in SSIS data flow? If so, you can add a data processing step between source and destination, check the column2 in that step.
Microsoft Online Community Support Please remember to mark the replies as answers if they help and unmark them if they provide no help.