Monday, October 19, 2015

SQL Server Create Table Script

 Sample SQL Script to create a table with the following requirements:

  1. Auto Incrementing numeric Primary Key
  2. Columns with default values (InsertDate and UpdateDate)
  3. Calculated column (Age)
  4. Unique constraint to prevent duplicate records
  5. Check constraint to limit data
  6. Foreign Key constraint to create data relationship
  7. Specify File Group for data storage