evanwang

evanwang

  • NA
  • 4
  • 0

How to execute sql script

Jan 7 2005 2:53 PM
I want to create a stored procedure in my database programatically in my c# code. As far as I could find, here are the following ways to do it and why I can't use them. MARS - I'm not using ADO.NET 2.0 nor do I have SQL Server 2005 Execute using SqlCommand using one long string - The stored procedure will get loaded as one long string, so it's very hard to read when viewed in the database. osql.exe - I have to load a bunch of procedures. If I use osql, I have to get a connection for every script I run. This takes way too long. Are these the only ways to do what I want to do? I just can't believe it's that hard to do in C#. - I must be missing something. Thanks.

Answers (1)