What are constraints?



What are constraints?..

Answer / Atul Chaudhary

Constraints in SQL Server are rules that control the type and nature of data that can be stored in a column or table. Constraints include primary keys, foreign keys, check constraints, unique constraints, and default constraints.nExample:n```sqlnCREATE TABLE TableName (Id INT PRIMARY KEY);nALTER TABLE TableName ADD CONSTRAINT chk_Column CHECK (Column > 0);```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are rows and columns?

1 Answers  


What is resource governor in sql server?

1 Answers  


What is WITH CHECK OPTION

3 Answers   Karur Vysya Bank KVB,


What is the use of placing primary key and foreign key constrains on columns.

4 Answers   Value Labs,


Is index a datbase objects in sql server?

2 Answers  


Explain the storage models of OLAP?

1 Answers  


What is stored procedures?

1 Answers  


Explain what is cte (common table expression)?

1 Answers  


Which index created when Create Index on table(col), Why

2 Answers   CGI,


Can a stored procedure call itself(recursive). If yes what level and can it be controlled.?

2 Answers  


What is a trace frag? Where do we use it?

1 Answers  


as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration

1 Answers  


Categories