Connection Vs. Command

Connection Vs. Command

Post by Jason Bower » Sat, 29 Jan 2000 04:00:00



Does anybody know the difference between executing a SQL statement off of
the Command.execute method Vs. using the Connection.Execute method?

Thanx
Jason

 
 
 

Connection Vs. Command

Post by Greg Jackso » Sat, 29 Jan 2000 04:00:00


1. Connection object can not provide Parameters (For Stored Procs)
2. Connection object can not be set up as a prepared statement

Gregory A Jackson MCSD, MCT
Sr. Software Engineer
STEP Technology
PDX, OR


Quote:> Does anybody know the difference between executing a SQL statement off of
> the Command.execute method Vs. using the Connection.Execute method?

> Thanx
> Jason


 
 
 

Connection Vs. Command

Post by Colin Youn » Sat, 29 Jan 2000 04:00:00


You have probably used a statement like:


The command object uses a parameter object that defines the direction of the
parameter, its data type, size, etc. and the type of command (stored
procedure, select, etc.). The parameter objects will also take care of
single quotes for you (i.e. you don't need to replace apostrophes in a
string).

Colin


> Thank you Greg for your post. However, I have successfully provided
> parameters to the connection object and executed stored procedures. What
do
> you mean by "prepared statement", im kind of a newby and have never herd
> this term.

> Thanks
> Jason



> > 1. Connection object can not provide Parameters (For Stored Procs)
> > 2. Connection object can not be set up as a prepared statement

> > Gregory A Jackson MCSD, MCT
> > Sr. Software Engineer
> > STEP Technology
> > PDX, OR



> > > Does anybody know the difference between executing a SQL statement off
> of
> > > the Command.execute method Vs. using the Connection.Execute method?

> > > Thanx
> > > Jason

 
 
 

Connection Vs. Command

Post by Jason Bower » Sun, 30 Jan 2000 04:00:00


Thank you Greg for your post. However, I have successfully provided
parameters to the connection object and executed stored procedures. What do
you mean by "prepared statement", im kind of a newby and have never herd
this term.

Thanks
Jason


> 1. Connection object can not provide Parameters (For Stored Procs)
> 2. Connection object can not be set up as a prepared statement

> Gregory A Jackson MCSD, MCT
> Sr. Software Engineer
> STEP Technology
> PDX, OR



> > Does anybody know the difference between executing a SQL statement off
of
> > the Command.execute method Vs. using the Connection.Execute method?

> > Thanx
> > Jason

 
 
 

Connection Vs. Command

Post by Jason Bower » Sun, 30 Jan 2000 04:00:00


Is there any performance difference?
Jason


> You have probably used a statement like:


> The command object uses a parameter object that defines the direction of
the
> parameter, its data type, size, etc. and the type of command (stored
> procedure, select, etc.). The parameter objects will also take care of
> single quotes for you (i.e. you don't need to replace apostrophes in a
> string).

> Colin



> > Thank you Greg for your post. However, I have successfully provided
> > parameters to the connection object and executed stored procedures. What
> do
> > you mean by "prepared statement", im kind of a newby and have never herd
> > this term.

> > Thanks
> > Jason



> > > 1. Connection object can not provide Parameters (For Stored Procs)
> > > 2. Connection object can not be set up as a prepared statement

> > > Gregory A Jackson MCSD, MCT
> > > Sr. Software Engineer
> > > STEP Technology
> > > PDX, OR



> > > > Does anybody know the difference between executing a SQL statement
off
> > of
> > > > the Command.execute method Vs. using the Connection.Execute method?

> > > > Thanx
> > > > Jason

 
 
 

Connection Vs. Command

Post by Egbert Niero » Tue, 01 Feb 2000 04:00:00


it is not measureable for ASP because ASP releases ADO objects from memory
(frees) (be glad it does for scalability). When the object was prepared or
with other words it is 'compiled, sort of' it's compilation plan is also
unloaded.

Preparing even could slow down the performance because of the creating of
sp's and the need of destroying again.


> Is there any performance difference?
> Jason



> > You have probably used a statement like:


> > The command object uses a parameter object that defines the direction of
> the
> > parameter, its data type, size, etc. and the type of command (stored
> > procedure, select, etc.). The parameter objects will also take care of
> > single quotes for you (i.e. you don't need to replace apostrophes in a
> > string).

> > Colin



> > > Thank you Greg for your post. However, I have successfully provided
> > > parameters to the connection object and executed stored procedures.
What
> > do
> > > you mean by "prepared statement", im kind of a newby and have never
herd
> > > this term.

> > > Thanks
> > > Jason



> > > > 1. Connection object can not provide Parameters (For Stored Procs)
> > > > 2. Connection object can not be set up as a prepared statement

> > > > Gregory A Jackson MCSD, MCT
> > > > Sr. Software Engineer
> > > > STEP Technology
> > > > PDX, OR



> > > > > Does anybody know the difference between executing a SQL statement
> off
> > > of
> > > > > the Command.execute method Vs. using the Connection.Execute
method?

> > > > > Thanx
> > > > > Jason