tags:

views:

24

answers:

1

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 :-)

A: 

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!

marc_s