execute more then one command in one Command execution ?

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
 
W

William \(Bill\) Vaughn

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.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top