Skip to Content.
Sympa Menu

freetds - AW: Multi statement SQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Schörk, Andreas" <andreas.schoerk AT infor.de>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: AW: Multi statement SQL
  • Date: Wed, 8 Nov 2000 15:50:51 +0100


Hello,
I do not know how it is solved on tds-level, but I can describe a little
how it is handled when you use ODBC or OLEDB.
When you execute multiple statements in mssql in one go
(normally it´s called batch) including more than one select, you get
multiple resultssets back.

These are the complete results of each query in the batch.
There you do not fetch single records from different statements alternating.
In your programcode you can first fetch the first resultsset when it is done
you can handle the next and so on.

The same is returned, when you call a procedure returning the results
of more than one selectstatements.
This is the case when the results of these statements are not eaten up
by using cursors or variables.

The disturbing fact seems to be that with sqlserver you always have max. one
resultsset per connection opened. To handle more than one the same time
you have to open so called server-side cursors by a special commands or by
using special stored procedures. But if you do this, work with more than one
cursurs the same time on a connection reading data from the server will slow
down about 5 to 10 times compared with reading it separately.
hope this helps to clarify a bit.

Andreas

-----Ursprüngliche Nachricht-----
Von: Nil Alexandrov [mailto:nil AT internet2.ru]
Gesendet: Mittwoch, 8. November 2000 15:21
An: TDS Development Group
Betreff: [freetds] Multi statement SQL


Hello !

I don't understand how can I use multi statement in MSSQL - how does it
work. In other SQL databases - the first, I create database connection
handle, than, I can create transaction handle based on database connection
handle, than I can use many statement handle base on transaction handle at
the same time.

So, I can start 'select ...', than fetch some rows, start another
'select ...' and fetch from the first statement and from the second
statement at the same time.

How does it implement in TDS level ? I need to create new connection to
SQL Server to start new statement, isn't it ?

Best regards, Nil.
E-Mail: nil AT internet2.ru


---
You are currently subscribed to freetds as: [andreas.schoerk AT infor.de]
To unsubscribe, forward this message to
$subst('Email.Unsub')



  • AW: Multi statement SQL, Schörk, Andreas, 11/08/2000

Archive powered by MHonArc 2.6.24.

Top of Page