This question is very similar
However I do not want to disable all triggers one of the commands Batch, but only for a single INSERT.
I have to deal with a shop system where the original author had put some application logic in a trigger (bad idea!). This application logic works fine until you try to insert data in the other way than the original "administration frontend". My job is to write the "import from staging system" tool, so I have all the data ready When I try to insert it, the trigger generates an existing product code (identification no numerical ID!) With the generated one to generate the code C using Otojenereted ID to put in another table is, so that I can not work with @@ Identity to update the cast went online with finding your insert columns and actual product code.
Either way I can go to avoid the most awkward code (insert some random characters in the product name and then try to find the row with random characters to update it) .
Inactive one for INSERT
You can disable the triggers by using triggers by:
Optional table MyTable disabled triggers all
But that's all it's for the session, not only your current connection .. which is clearly a very bad thing to do: -)
The best way to change yourself is to change Will order it decides that it needs to run, whether it's flag or something "table type" Insert other methods that have the uncanny stored a type of Y type.
Comments
Post a Comment