|
|
-
Paras Dave Replied 12 Months ago through ASK | 1 Point
**Solution:**
**Step 1: Delete Foreign Keys:**
Execute following script, it will generate script for delete all foreign keys.
<pre class="brush: plain">SELECT DropStmt = 'ALTER TABLE [' + ForeignKeys.ForeignTableSchema + '].[' +
ForeignKey...
|
0
·
0% ·
0
|
|
-
Paras Dave Commented 12 Months ago through Ask | 10 Points
**Solution:**
**Step 1: Delete Foreign Keys:**
Execute following script, it will generate script for delete all foreign keys.
SELECT DropStmt = 'ALTER TABLE [' + ForeignKeys.ForeignTableSchema + '].[' +
Foreign...
|
-
Paras Dave Replied 12 Months ago through ASK | 1 Point
Hello Mitesh Modi,
1. Below link **does not generate correct Script for foreign key having more than one column**.
<br /><a target="_blank" href="http://stackoverflow.com/questions/868620/sql-script-to-alter-all-foreign-keys-to-add-on-delete-cascade">...
|
0
·
0% ·
0
|
|
-
Paras Dave Commented 12 Months ago through Ask | 10 Points
Hello Mitesh Modi,
1. Below link **does not generate correct Script for foreign key having more than one column**.
-
Paras Dave Replied 12 Months ago through ASK | 1 Point
Hello Alpesh Gorasia,
Your script may be useful but ONLY WHEN you have foreign key on single field.
If you have COMPOSITE PK then obviously you have Foreign Key on Multiple Field.
In this case, above script Generate Script for every column separatel...
|
0
·
0% ·
0
|
|
|
-
Paras Dave Commented 12 Months ago through Ask | 10 Points
Hello Alpesh Gorasia,
Your script may be useful but ONLY WHEN you have foreign key on single field.
If you have COMPOSITE PK then obviously you have Foreign Key on Multiple Field.
In this case, above script Generate Script for every column separa...
|
-
Paras Dave Question Asked 12 Months ago through ASK | 2 Points
It is required to set **Update Rule** to **Cascade** for *every foreign key constraint in database*.
It can be done by creating constraint, but is it possible to set Cascade on ***without drop or recreating foreign key constraint in SQL Server 2008.***...
|
-
Paras Dave Posted 12 Months ago through Ask | 10 Points
It is required to set Update Rule to Cascade for every foreign key constraint in database.
It can be done by creating constraint, but is it possible to set Cascade on without drop or recreating foreign key constraint in SQL Server 2008.
Please let me ...
|
-
Paras Dave Question Asked 12 Months ago through ASK | 2 Points
It is required to set **Update Rule** to **Cascade** for *every foreign key constraint in database*.
It can be done by creating constraint, but is it possible to set Cascade on ***without drop or recreating foreign key constraint in SQL Server 2008.***...
|
ask
98
·
2% ·
538
|
|
-
Paras Dave Posted 12 Months ago through Ask | 10 Points
It is required to set Update Rule to Cascade for every foreign key constraint in database.
It can be done by creating constraint, but is it possible to set Cascade on without drop or recreating foreign key constraint in SQL Server 2008.
Please let me ...
|