4

I'm using Microsoft SQL Server 2008 R2 and I try to dump a table via bcp (with a scheduled Job). First of all I implemented it with xp_cmdshell, but I've heard, that this should be avoided due to security reasons.

So my question: What's about sp_oaMethod? Should it be used? If not, why not? And could you suggest other possibilities?

4

1 回答 1

1

xp_cmdshell使用“CmdExec”或“Powershell”类型的 SQL 代理作业步骤更好的解决方案。

CmdExec将是我对BCP.exe. 创建作业步骤需要系统管理员凭据。

如果您需要执行任何其他任务,例如压缩提取的文件并将其复制到网络共享,Powershell就是您的选择。

于 2012-12-03T22:59:36.567 回答