It is always faster to not use a transaction, but the answer really
depends on what your command does. If the query contains a single
UPDATE, INSERT, or DELETE statement, then the command is already
atomic and will have an implicit transaction.
If there are multiple statements inside, and you need them to behave
atomically (if one fails - everything inside the transaction fails and
changes rollback), then you'll need a transaction no matter what the
performance hit.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Mon, 6 Dec 2004 12:33:34 -0500, "Chance Hopkins"
<ch************@hotmail.com> wrote:
When using the sqlclient dotnet class and sql server.
is it faster when doing a single (not multiple) insert to:
1- just do a simple connection and command object, then execute a nonquery
2-use a transaction, connection and command object to execute a nonquery and
then commit the transaction
Thanks