Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I want to set (Insert and Update specification==>delete rule==>cascade)
But there aren't such settings in Visual Studio 2012
What should I do so like Visual Studio 2008 through Cascade do?
Thanks.

What I have tried:

I work with vs 2012,
I create a foreign key and set (( FOREIGN KEY ([Column]) REFERENCES [ToTable]([ToTableColumn]) )).
Now i want to set Delete Rule and Update Rule but I do not know how to do it.
Posted
Updated 3-Aug-16 20:42pm
Comments
Suvendu Shekhar Giri 2-Aug-16 4:32am    
Seems UI support is not available in VS 2012 but you can always do that in your SSMS or through query.

1 solution

If its the script you're looking for, then read this: Create Foreign Key Relationships[^]

Here's an example on delete cascade
SQL
USE AdventureWorks2012;    
GO    
CREATE TABLE Sales.TempSalesReason (TempID int NOT NULL, Name nvarchar(50),     
CONSTRAINT PK_TempSales PRIMARY KEY NONCLUSTERED (TempID),     
CONSTRAINT FK_TempSales_SalesReason FOREIGN KEY (TempID)     
    REFERENCES Sales.SalesReason (SalesReasonID)     
    ON DELETE CASCADE -- <----- Look here
    ON UPDATE CASCADE    
);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900