c#


Filter Table Triggers when using SMO DependencyWalker


I have a database with numerous tables that I use the SMO DependencyTree and DependencyWalker to order them by dependencies and then script them out. However, there are two particular tables that have the following relationship:
CREATE TABLE Production_Events (
Event_Id int identity(1,1) NOT NULL,
Start_Time datetime NOT NULL,
End_Time datetime null
--... other columns
)
CREATE TABLE Production_Event_Data (
Production_Event_Data_Id int identity(1,1) NOT NULL,
Event_Id int NOT NULL, -- Foreign key to the above table
Variable_Id int NOT NULL, -- Foreign key to another table
Variable_Value varchar(25) NULL
--... other columns
)
The Production_Event table has a FOR INSERT trigger which populates the Production_Event_Data table with values that come from various sources when a new row is inserted in Production_Event.
If there is no trigger present on the Production_Event table, the DependencyWalker will properly order these tables for scripting by detecting the Foreign Key relationship between them. However, if the trigger is present, then DependencyWalker sees the trigger as a dependency and orders the tables incorrectly by putting the Production_Event_Data table before the Production_Events. Ultimately this will end with a Foreign Key Constraint error if you try to execute the script.
Is there a way to configure DependencyWalker to only account for table dependencies and NOT trigger dependencies?

Related Links

Unit Test Async WebAPI 2 Get Request
Error while generating views with with Mysql and EF6
Identifying specific field that fails a conversion during a Database Query
EF Core “Invalid column name 'Discriminator'” error with inheritance
Gridview post back event
Got Unhandled Exception :: System.Xml.XmlException: Text node cannot appear in this state
“Syntax error in FROM clause” using OleDb in C# but no error for same query in Access itself
Custom Effect on model instance makes BasicEffect unrecognizeable on other (separately loaded) instance
Issue with Xamarin App Connecting to WCF Service over https
Reactive Extensions / UI cache web request data
ListView in UWP has unexpected behavior when INotifyCollectionChanged reports bulk changes
Singleton: create instance inside static constructor [duplicate]
2d array calculator in C# [closed]
Set TextBlock's ToolTip content
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code when creating a List
Non-Interface methods [closed]

Categories

HOME
autohotkey
netty
qemu
lithium
psexec
aggregate-functions
markdown
genexus
pyodbc
wkhtmltopdf
ethereum
activejdbc
jcodemodel
facebook-sharer
decoding
email-attachments
virtualenv
brightway
taxonomy
template10
ringcentral
wallet
audio-streaming
autologin
scotty
caldav
opengraph
policy
chartist.js
android-6.0-marshmallow
vtd-xml
loopback
log4net-configuration
contextmenustrip
microstrategy
ponylang
rtsp
server-side-swift
contenteditable
paperclip
binary-decision-diagram
html-entities
niagara-ax
cloudconvert
fckeditor
cc
codesniffer
acceleo
apache-commons-cli
vertex-shader
timefield
ownership
disconnect
nimbus
angularfire
hotkeys
window.location
nugetgallery
jts
persian
vanilla-forums
cyberduck
tooltwist
valdr-bean-validation
perfect-scrollbar
conkeror
applinks
sony-xperia
iphone-6
grunt-contrib-connect
illegalargumentexception
go-gin
xmlserializer
breeze-sharp
satisfiability
dayofweek
logo-lang
node-amqp
xcode6.1-gm-seed
jfilechooser
ojb
nsnumber
violation
record-locking
typography
source-depot
dynamic-expresso
uikit-dynamics
nx
generator-expression
dnsbl
cron4j
idoc
states
django-1.4
project-files
capitalization
execjs
jexcelapi
excellibrary
web-search
opengl-to-opengles
managed-code
httpbrowsercapabilities
office-2003
memory-consumption

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App