StatCounter

View My Stats

Monday, February 4, 2008

Adding a constraint to the esisting Table-SQL Server

The query as Follows:

ALTER TABLE TableName ADD CONSTRAINT pk_employee PRIMARY KEY (EmployeeId)

Here
pk_employee - constraint Name
EmployeeId -ColumnName of the Table

While adding the constraints to the before Existing table..that column name set to notNull(it must)

No comments: