Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
michaelnicholas
Starting Member
3 Posts |
Posted - 2011-12-13 : 14:50:37
|
| I have a table which gets written to by an external web service via an XML bulk load operation.In the data that gets written (usually one row at a time), I have a record in the last column that I need to populate every time a row gets added. I already have it working in a package that runs successfully when I run it manually. HOWEVER, when I add a trigger to the table to try and execute my package, the bulk insert fails and just creates temporary bulkload tables and the Header table gets locked up.Here's what I have for the trigger. Is this causing some sort of killer loop? What should I be doing instead of this?ON [dbo].[Header] AFTER INSERTAS EXEC xp_cmdshell 'dtexec /f "C:\SSIS_Packages\fs_AddOrderRecordID.dtsx"' |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
pnash
Starting Member
26 Posts |
Posted - 2011-12-13 : 14:58:08
|
| Try with Creating a agent job for " EXEC xp_cmdshell 'dtexec /f "C:\SSIS_Packages\fs_AddOrderRecordID.dtsx" and call it after Insert in your trigger. |
 |
|
|
michaelnicholas
Starting Member
3 Posts |
Posted - 2011-12-13 : 15:11:35
|
| Tara do you mean a "computed column"? That method would be independent of a trigger entirely right? I'm trying to link that OrderRecordID to another table as well - do you think I could do this with a computed column? I need to do it every time an order arrives via the bulk insert (which is kinda misleading because it is usually only one order at a time). |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
michaelnicholas
Starting Member
3 Posts |
Posted - 2011-12-14 : 10:50:12
|
| Great! I appreciate your help Tara.. I really want to try to figure out/learn to write the trigger myself. I'll let you know if I get totally stumped! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|