SQL Server Performance

Default Value

Discussion in 'SQL Server 2005 General Developer Questions' started by ismailadar, Mar 24, 2010.

  1. ismailadar New Member

    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?
  2. satya Moderator

    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.
  3. FrankKalis Moderator

    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?
  4. Madhivanan Moderator

    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
  5. venkatesanj@hcl.in New Member

Share This Page