J
john
I would like to be able to run a batch sql script from inside my
application on a SQL Server 2K database. The script has all sorts of
commands (inserts, updates, deletes, creating indexes, etc.). It's the
sort of thing that I could copy into a window of Query Analyzer and
run. It could be pretty big (if saved to a text file on my hard drive,
it's over 1 meg). What is the best way to execute it with ADO.NET? I
could have a string that is the entire script and try to use
ExecuteNonQuery, but I don't know if there is a limit to the size of
this query. Another application of this thinking is if I need to
insert a bunch of records, it would probably have better performance
(i.e. less round-trips to the database) if I put a bunch of of the
INSERT statements into one string and execute it than to execute a
bunch of different INSERT statement strings.
Thanks in advance.
application on a SQL Server 2K database. The script has all sorts of
commands (inserts, updates, deletes, creating indexes, etc.). It's the
sort of thing that I could copy into a window of Query Analyzer and
run. It could be pretty big (if saved to a text file on my hard drive,
it's over 1 meg). What is the best way to execute it with ADO.NET? I
could have a string that is the entire script and try to use
ExecuteNonQuery, but I don't know if there is a limit to the size of
this query. Another application of this thinking is if I need to
insert a bunch of records, it would probably have better performance
(i.e. less round-trips to the database) if I put a bunch of of the
INSERT statements into one string and execute it than to execute a
bunch of different INSERT statement strings.
Thanks in advance.