SQL Server validates data primarily with constraints. Constraints give you tremendous flexibility in policing data input. SQL Server recognizes five types of ANSI standard constraints: CHECK, DEFAULT, UNIQUE, PRIMARY, FOREIGN KEY. PRIMARY and FOREIGN KEY constraints relate to referential integrity.