dbTalk Databases Forums  

SET NOCOUNT e cursori

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SET NOCOUNT e cursori in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SuperPippo
 
Posts: n/a

Default SET NOCOUNT e cursori - 10-20-2005 , 04:43 AM






Buongiorno a tutti,
ho un DTS che contiene tra le altre cose un "Execute SQL Task" che
lancia una SP.

All'interno della SP (abbastanza articolata) c'è un cursore che ogni
volta che fa un loop, per ragioni che non sto a spiegare, fa una select
con un codice di processo.

La procedure lanciata da Query Analyzer si pianta ("resource is too
low") dopo un certo tempo per il numero elevato di recordset in uscita.
Va bene, me lo aspettavo.

Quello che non mi aspettavo è che messa all'interno del task del DTS e
lanciata (sia con l'execute step sia lanciando il DTS globale) sembra
che il cursore faccia il fetch delle prime 10-15 righe delle 1000
preventivate, eseguendo la procedura (e quindi la select) per poi
uscire senza messaggi d'errore.

SOLUZIONE:
All'interno della procedura ma all'esterno del cursore c'è un SET
NOCOUNT. Commentandolo il cursore esegue il fetch su tutte le righe
della select anche dal DTS.

DOMANDE:
Qualcuno ha mai riscontrato un problema del genere?
C'è una spiegazione a questo comportamento?

Grazie mille (e tanti complimenti) a tutti coloro che sapranno
rispondermi.

Davide


Reply With Quote
  #2  
Old   
Thomas Bradshaw via SQLMonster.com
 
Posts: n/a

Default Re: SET NOCOUNT e cursori - 10-20-2005 , 11:50 AM






To Others:

Here is what I think SuperPippo says:

--====================

- I have an "Execute SQL task" exists between two other tasks
- This task contains a Stored Procedure (SP)
- The SP contains a cursor
- When running this cursor from Query Analyzer, it process 10-15 lines, then
throws a warning "Resource is too low"
- This warning causes problems in the body of the cursor
- My solution is to use a SET NOCOUNT inside the stored procedure prior to
the cursor code

Questions:
- Has anyone else seen this problem before?
- Is there an explanation for this behavior?

Thanks to all who know how to answer me - David

--====================

Thomas Bradshaw
MyWebGrocer.com
Data Integration Services


--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #3  
Old   
SuperPippo
 
Posts: n/a

Default Re: SET NOCOUNT e cursori - 10-21-2005 , 09:46 AM



Is not correct.
I remove the SET NOCOUNT inside of the SP. If I leave the SET NOCOUNT
the cursor fetch only the first 10-15 rows and exit with success. This
problem occured only if I run the SP inside of "Execute SQL task". In
QA it works.

Thanks
Davide


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.