22.4.11

Constraints on the whole table in SQL Server

One of my blog reader have asked me a query, Is it possible to give constraints to all the columns in a table in a single shot?

CREATE TABLE dbo.Venkat_Table



(
   id int primary key,
   Name varchar(50) unique,
   Age int Unique
)



Yes it's possible. We can provide the constraints.

Applying terms and conditions -> The constraints should not conflict with one another. Primary key constraints can be given only once for a table.
Cheers,




Venkatesan Prabu .J
Head - WWW.Kaashivinfotech.com
http://venkattechnicalblog.blogspot.com/

No comments:

Post a Comment