Guest User

Untitled

a guest
Mar 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. create table employees (
  2. id int identity(1,1) primary key,
  3. givenname nvarchar(24) not null,
  4. familyname varchar(24) not null,
  5. tfn char(9) unique -- optional, but unique
  6. );
  7.  
  8. create table employees (
  9. id int identity(1,1) primary key,
  10. givenname nvarchar(24) not null,
  11. familyname varchar(24) not null,
  12. tfn char(9)
  13. );
  14. CREATE UNIQUE NONCLUSTERED INDEX uq_employees_tfn ON employees(tfn)
  15. WHERE tfn IS NOT NULL;
  16.  
  17. create table employees (
  18. id int identity(1,1) primary key,
  19. givenname nvarchar(24) not null,
  20. familyname varchar(24) not null,
  21. tfn char(9) NULL
  22. INDEX uq_employees_tfn
  23. UNIQUE (tfn)
  24. WHERE tfn IS NOT NULL
  25. );
Add Comment
Please, Sign In to add comment