0

I hope you are well!

I used code from a another thread/problem on stack overflow (Generating SQL Server DB from XSD) and it worked really nice up until one point. I honestly don't know enough about SQL and MS SQL to debug and fix this. any help will be appreciated.

As far as I understand you need to specify if it should cascade delete and cascade update, if that is the case, I want to do it, just don't know how. See 'my' code and the error in the screenshot below:

Pic of code + error

jarlh
  • 42,561
  • 8
  • 45
  • 63
Hancs
  • 303
  • 1
  • 5
  • 19
  • 2
    Is there a reason you're using SMO instead of sending equivalent SQL to the server? – Dai Sep 19 '18 at 15:16
  • @Dai Well I didn't write the code, I updated my post with the link where I found the code, I am just trying to write my XSD to my SQL Server database. It is quite a huge XSD other wise I would've done it manually – Hancs Sep 19 '18 at 15:20
  • @Hancs https://stackoverflow.com/questions/851625/foreign-key-constraint-may-cause-cycles-or-multiple-cascade-paths/852047 – Vijay Sep 19 '18 at 15:40
  • @Vijay Thanks! So at least now I know that I should specify no action on delete/update. Now how do I do that in the code example above? Do you have any idea? – Hancs Sep 20 '18 at 09:16

0 Answers0