Executing more than 1 SQL command at once.

nuciwopl

New Member
Hi!<BR><BR>I've recently heard that it's possible to execute more than 1 SQL statement with the execute command, at once without separating them with semi-colons.<BR><BR>Sounds small, but i was wondering if this was true, and if so, could someone give me a very basic example please?<BR><BR>Thanks in advance,<BR><BR>hellz.Just append your commands. <BR>Here's an example. It works in asp.net or classic asp.<BR><BR>Dim StrConnect<BR>StrConnect = "(YOUR CONNECT STRING)"<BR>Dim sql<BR>sql = "insert into Sample(Name) values ('1234'); insert into Sample(Name) values ('3456');"<BR>Dim cn<BR>cn = CreateObject("ADODB.Connection")<BR>cn.open(strConnect)<BR>cn.execute(sql)<BR>
 
Back
Top