enrique_aeo
asked on
sql server 2012 - create table (references)
hi experts,
i have this table
create table Employee
(
EmpID int NOT NULL PRIMARY KEY,
EmpName varchar (25) not null
DeptID references Department (id)
JobTitle varchar (10)
)
why the primary key constraint could be removed from EmpID column of the Employee table without creating a problem in the parent/child relationship
Any example, please
i have this table
create table Employee
(
EmpID int NOT NULL PRIMARY KEY,
EmpName varchar (25) not null
DeptID references Department (id)
JobTitle varchar (10)
)
why the primary key constraint could be removed from EmpID column of the Employee table without creating a problem in the parent/child relationship
Any example, please
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try
alter table Employee
drop primary key
go
Do you mean to remove the PK of current table? If yes, try the above.
ASKER
I can explain this:
why the primary key constraint could be removed from EmpID column of the Employee table without creating a problem in the parent/child relationship
with transact sql code
why the primary key constraint could be removed from EmpID column of the Employee table without creating a problem in the parent/child relationship
with transact sql code
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No, I only this code
create table Employee
(
EmpID int NOT NULL PRIMARY KEY,
EmpName varchar (25) not null
DeptID references Department (id)
JobTitle varchar (10)
)
create table Employee
(
EmpID int NOT NULL PRIMARY KEY,
EmpName varchar (25) not null
DeptID references Department (id)
JobTitle varchar (10)
)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER