SMO 客户端缺少 dll
我创建了一个远程连接到 SQL Server 2008 的应用程序。SQL 连接可以工作,所有传统的 oCommand.ExecuteNonQuery() 都工作得很好!
但我的 SMO 类使用 server.ConnectionContext.ExecuteNonQuery(scriptfile); 错误:缺少批处理 parsing.dll 。
我无法在客户端计算机上安装这些独立的实用程序,然后在完成后将它们全部删除: 正如建议的: http: //www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=228de03f-3b5a-428a-923f-58a033d316e1
由于我的批量插入占用了包含完整表的大量内存,因此我编写了这些表到 temptable.sql 文件并使用 SQLCMD Util,后来切换到 SMO,我也遇到了同样的问题。这些都不能在客户端的 PC 上使用。有什么建议吗?谢谢 :-)
I've created an app that connects remotely to SQL Server 2008. SQL connections work and all traditional oCommand.ExecuteNonQuery(), work great!
But my SMO class using server.ConnectionContext.ExecuteNonQuery(scriptfile);
ERROR: missing batch parsing.dll .
I can't install these independent utils on a client machines, and then take them all off when done:
as suggested by: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=228de03f-3b5a-428a-923f-58a033d316e1
Since my bulk-inserts are large memory hogs containing complete tables, I wrote the tables to a temptable.sql files and used SQLCMD Util and later switch too SMO and I have the same problem. Neither of these can be leveraged on the client's PCs . Any suggestion? thanks :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,有两件事:
如果您想在应用程序中使用 SMO,您需要确保客户端计算机上安装了 SMO 组件。您可以从 Microsoft 获取 SMO 二进制文件,然后可以将它们与您的应用程序一起发送和安装 - 但这是您将这些合法地获取到客户端计算机上的唯一方法
如果您做不到这一点,那么看看SqlBulkCopy 类。这是专门为批量插入大量数据而设计的,它是 ADO.NET 2.0 的一部分 - 无需额外安装。 MSDN 库中有一个完整的章节介绍 SQL Server 批量操作 -检查一下!
Well, two things:
if you want to use SMO in your apps, you need to make sure the SMO components are installed on the client machines. You can grab the SMO binaries from Microsoft and you can ship and install them with your app - but that's the only way you'll get those onto the client's computer legally
if you can't do that, how about checking out the SqlBulkCopy class. This is designed specifically for bulk inserting large volumes of data, it's part of ADO.NET 2.0 - no extra installs. There's a whole section in the MSDN library on SQL Server Bulk Operations - check it out!