Hi all, I have a table and i wanna give a default value to this varchar coloum after insert a record. I fill the Default value or Binding Property like xxx.com/default.aspx?Id='+Convert(varchar(5),RecordID) but i do not achieve to add id coloum to Varchar How can achieve this?
To apply defaults, create a default definition by using the DEFAULT keyword in CREATE TABLE. This assigns a constant expression as a default on a column. For more information refer to SQL Server books online.
Are you sure that you need to store that column? Wouldn't it be "good enough" to output it in your queries or maybe even have it as computed column?
I would like to output it when you use SELECT statement If you dont want to do it everytime you write, create a view having that computed column and use that view for selection
Check my blog article on defaults, http://venkattechnicalblog.blogspot.com/2010/04/defaults-in-sql-server.html Cheers, Venkatesan Prabu .J