0

How does SQL Server or Oracle or any database server applies constraints on the table>

I am aware of constraints, but how they are applied on the table or a column? I tried to find how SQL Server understands a requirement for a constraint and maintain the integrity.

Is there a Store Procedure or User defined function for applying a constraint? How does database server understand this scenario, when user is requested for mount a constraint on a table?

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Andrew
  • 179
  • 2
  • 15
  • is it a really tough question that no one able to answer this.or a idiotic one – Andrew Feb 17 '12 at 06:13
  • 1
    Your question is difficult to understand. Are you asking how a database administrator *creates* a constraint on a column, or how the database engine *enforces* the constraint when rows are inserted or updated? – Wyzard Feb 17 '12 at 07:46
  • How database enforces the Consraint. – Andrew Feb 17 '12 at 08:21

1 Answers1

0

Have you looked at Microsoft's documentation page on constraints? There are many types of constraints so the DML syntax will differ for each. To your direct question no, they are not applied by using stored procs or UDF's, it's just TSQL syntax. You can also right-click on a table in SSMS and go into the designer. All constraint types can be managed their instead of raw TSQL.

sisdog
  • 2,649
  • 2
  • 29
  • 49