【发布时间】:2015-05-29 18:15:45
【问题描述】:
我一直在寻找解决方案,但找不到任何有用的东西。我尝试过的一切似乎都不起作用。
我有两个数据库。我不能通过添加表或类似的东西来修改数据库 A。我无法启用跨数据库访问。我相信我不能使用 sp.Start_job 因为我需要传递参数。我能够启用 xp_cmdshell。
我的数据库定义:
Database A
- Order table
Database B
- Email notification Table
我需要做什么:
Any time an order is entered into Database A, I need to enter a row into Database B with values of the order. So I need to have parameters
我尝试过的:
- xp_cmdshell @query='DTEXEC /f "\\Server\Folder\SSIS Packages\Order confirmations\Order confirmations\Package.dtsx" /DECRYPT password'
1. I get an error saying access denied. I tried setting up sp_xp_cmdshell_proxy_account (##xp_cmdshell_proxy_account##) to an account that has access to the network drive where the file is stored, no luck.
2. whoami.exe shows NT/Authority \System instead of my proxy account.
3. GRANT EXECUTE on xp_cmdshell to [mydomain\myAccount] didnt have any affect.
有什么建议吗?如果我使用 SQL Server 代理进行设置,该作业运行良好。最终我会从数据库 A 表 Orders 上的触发器调用 xp_cmdshell 以将数据输入到数据库 B 中,然后在满足某些条件时使用 sp_send_dbmail 发送一封电子邮件。
【问题讨论】:
-
如果不能修改A,那你要怎么在里面实现触发器呢?
-
对不起,我只能添加一个触发器。我更多的是在谈论添加表格或添加列的结构。
标签: ssis sql-server-2008-r2 xp-cmdshell