SQL Server Performance

constraint or default option set in column

Discussion in 'SQL Server 2005 General DBA Questions' started by avipenina, Jan 27, 2008.

  1. avipenina New Member

    Hi,
    i need to create this table
    CREATE TABLE test (start_time DATETIME NOT NULL ,end_time DATETIME NOT null,
    total_time DATETIME CONSTRAINT check_total check(start_time - end_time))
    i need to insert in the total_time column the start_time - end_time result.
    how i do that?
    Thx
  2. ndinakar Member

    Use a computed column. Check out books online on how to do that.

Share This Page