Re: Output bufferring

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4e+4P3sjqbWxaivoW_LQP2S1Hk0B+deQmqeBVyviNWTJg@mail.gmail.com>
2016-04-14 8:18 GMT+01:00  <[email protected]>:
> Hello,
>
> we have following issue. In our application we're tring to match securities with our internal ID based on couple of international IDs. Securities are comming from different data providers during the night. We do have a procedure which is trying to match data from these feeds. This procedure is writen to iterate over period of time. At every iteration it prints out statistics about how many securities were matched, and how many securities has not matched, because data from external providers are missing. Everything works fine with MSSQL Studio and even with isql from freetds. However when we call out the procedure from our perl environment. Output is bufferred and this buffer is flushed when procedure finishes. We have tried tracing on several levels and we have found that in FreeTDS trac
 e log messages are written at every itteration. However in UnixODBC trace messages are shown when procedure finishes.
>
> Question is very easy. Who is the trouble maker? Is freeTDS bufferring messages on it's output (but after tracing log is written), or are these messages buffered in the UnixODBC?
>
> If you wish to reproduce, just let me know and I will prepare sproc for you.
>
> Thanks for your time & support.
> Jakub


I think what you are looking for is SET NOCOUNT option.

A bit of explanation. SQL Server during command (SELECTs, UPDATEs and
so on) send back number of row processed. Even during store procedure!
So even a simple command like "SELECT @var = 123" by default send back
the number of rows (in this case 1). Disabling the option reduce the
data sent back. For the SELECT case above you can also use SET
instead.
I would also suggest to use less queries and more join but not knowing
the code I could not suggest anything in particular.

Hope I guessed your problem.

Frediano
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.