execute more then one command in one Command execution ?

  • Thread starter Thread starter Yoramo
  • Start date Start date
Y

Yoramo

sounds vague I know sorry. I'll try to explain what I need.


I need to run a sql script that will initialize my tables and it needs to do
it on more then one table so the script will contain several SQL commands
to be run.

I wonder if I can load the SQL script into the commandText property and run
the ExecuteNonQuery method ?

Yoramo
 
It depends on the backend. JET does not support it, but SQL Server will
permit you to send virtually any number of operations at once (there are
rules though). I would write this as a stored procedure and execute it
once... It can walk whatever tables it needs to.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top