Executing SQL Create DB script from ADO.NET?

  • Thread starter Thread starter Brian Link
  • Start date Start date
B

Brian Link

I've scripted my database using Enterprise Manager's script utility.
Pretty much everything, including triggers & indexes & keys.

I load the .sql file into an ADO command, and try to execute it, but
have had no success. It seems like it hates the "GO" statements.
Anything quick anyone can think of to check? Thanks.

Brian Link, Minnesota Countertenor
 
Brian,

I would rather they test on animals than on me. That's just me. However I would use the SQLDMO object there is functionality create triggers and run scripts. It's a COM based object but there is an Interop for .Net. The Interop acts as a unpaid translator between COM and managed code.

-Calvin Luttrell
ProjectThunder.com
 
No, that's pretty much correct. As far as I recall ADO.Net's SQL parser will
bork at T-SQL blocks using GO etc. (Someone's going to prove me wrong now
and make me look a complete dork I know it).
 
Brian,

I would rather they test on animals than on me. That's just me. However I would use the SQLDMO object there is functionality create triggers and run scripts. It's a COM based object but there is an Interop for .Net. The Interop acts as a unpaid translator between COM and managed code.

-Calvin Luttrell
ProjectThunder.com

Thanks. That was it. For some reason I have this animosity toward more
Interop assemblies in my project. Maybe it's the old VB "I hate
dependencies - I wanna monolithic EXE" in me.

Brian Link, Minnesota Countertenor
 
Back
Top