soozh
asked on
Explain this TSQL
Below is some TSQL from a script that has been generated by Management Studio.
The first command "CHECK ADD CONSTRAINT" creates a foreign key constration, and I guess forces a cascade delete.
What does the second command "CHECK CONSTRAINT " do?
I am porting the database to a compact database i want to be sure i have included everything.
The first command "CHECK ADD CONSTRAINT" creates a foreign key constration, and I guess forces a cascade delete.
What does the second command "CHECK CONSTRAINT " do?
I am porting the database to a compact database i want to be sure i have included everything.
/****** Object: ForeignKey [FK_FormData_Units] Script Date: 08/31/2010 10:16:18 ******/
ALTER TABLE [dbo].[FormData] WITH CHECK ADD CONSTRAINT [FK_FormData_Units] FOREIGN KEY([uni_id])
REFERENCES [dbo].[Units] ([uni_id])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[FormData] CHECK CONSTRAINT [FK_FormData_Units]
GO
ASKER CERTIFIED 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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My sql for the compact database is :
ALTER TABLE FormData
ADD CONSTRAINT FK_FormData_Units
FOREIGN KEY(uni_id) REFERENCES Units(uni_id)
ON DELETE CASCADE ;
Do i need to add anything?