Multiple statement execution via ADO.NET

  • Thread starter Thread starter Martin Hart - Memory Soft, S.L.
  • Start date Start date
M

Martin Hart - Memory Soft, S.L.

Hi:

Is it possible to execute a complete script with different commands in one
execution under ADO.NET? If so, with which component and how? Do I have to
separate statements with 'GO'?

TIA,
Martin.
 
Hi Martin,

As far as I know just one SQL string adding to the command. It can have a
lot of commands in it.

Cor
 
Cor:

Are the statements separated by 'GO' commands?

TIA,
Martin.
 
Hi Martin,

I am not an SQL guy, however when you use a sqlcommand.nonquerry you can as
far as I know (I use it that way) do every SQL command as far as it is ok
with the syntax.

There is the special SqlException which you can catch using that.

Cor
 
Ah no.
If you want to execute a "batch" (several SQL statements separated by GO or
some other delimiter), you'll have to parse the inbound SQL strings and
separate them into scripts when you see <CR><LF>GO<CR><LF>. Each script must
be executed and completed separately before executing the next.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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