Re: Timing out????

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ralph Krausse (gordingin_at_consiliumsoft-nospam.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 11:30:41 -0400

Thanks I will try that. And to y I am using a cursor, well I am new to SQL
programming and well it worked when the table was small... :) Learning,
Learning, Learning...

"Narayana Vyas Kondreddi" <answer_me@hotmail.com> wrote in message
news:%23Nl6CSSXEHA.2520@TK2MSFTNGP12.phx.gbl...
> I don't see a real need for a CURSOR in your stored proc. Unless I am
> missing something, it should be something like this:
>
> UPDATE LookUp
> SET Active = '0'
> FROM
> LookUp AS L
> INNER JOIN
> tbDateDiff AS T
> ON L.IPSource = T.IP
>
> SET @IPResetCount = @@ROWCOUNT
>
> Also, do not use sp_ prefix, as that is reserved for system stored
> procedures, and means something different to SQL Server.
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
> Is .NET important for a database professional?
> http://vyaskn.tripod.com/poll.htm
>
>
> "Ralph Krausse" <gordingin@consiliumsoft-nospam.com> wrote in message
> news:uXQtoMSXEHA.796@TK2MSFTNGP10.phx.gbl...
> I am getting this error message with my SP
>
>
___________________________________________________________________________
>
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
(WrapperRead()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
>
> Connection Broken
>
___________________________________________________________________________
>
>
> ** My SP
>
>
>
> ALTER PROCEDURE sp_CleanUp
> as
> SET NOCOUNT ON
>
> DECLARE @IPResetCount BIGINT
> SET @IPResetCount = 0
>
> DECLARE tbDateDiff_cursor CURSOR FOR SELECT * FROM tbDateDiff
> OPEN tbDateDiff_cursor
> DECLARE @IP CHAR(16)
> FETCH NEXT FROM tbDateDiff_cursor Into @IP
> WHILE @@FETCH_STATUS = 0
> BEGIN
> Update LookUp Set Active = '0' where IPSource = @IP
> SET @IPResetCount = @IPResetCount + 1
> FETCH NEXT FROM tbDateDiff_cursor Into @IP
> END
> Close tbDateDiff_cursor
> DEALLOCATE tbDateDiff_cursor
>
>
> Print COnVERT(char(40),@IPResetCount)
> return @IPResetCount
>
>
> GO
> --------------------------------------------------------------
>
> If I remove the code
>
> Update LookUp Set Active = '0' where IPSource = @IP
>
> this SP NEVER returns that error.
>
> btw. the 'tbDateDiff' table has 227,000+ records in it...
>
>
> ANYONE???? PLS.....
>
>
> Thanks
> Ralph Krausse
> www.consiliumsoft.com
> Use the START button? Then you need CSFastRunII...
> A new kind of application launcher integrated in the taskbar!
> ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
>
>
>



Relevant Pages

  • Re: Opinions on approach, please...
    ... Code conversion is much more tricky. ... to update more than 32k records without a commit in-between. ... I advise you to do cursor definitions on working storage). ... I don't want to see ANY SQL code in them. ...
    (comp.lang.cobol)
  • Re: Opinions on approach, please...
    ... To emulate this I plan on using an SQL cursor. ... I COULD do it with a resultset if it wasn't in COBOL or could ... Is it because when you FETCH from a cursor you go back to the ...
    (comp.lang.cobol)
  • Re: Opinions on approach, please...
    ... to update more than 32k records without a commit in-between. ... Translating the above to SQL it would be as follows. ... I advise you to do cursor definitions on working storage). ... exec sql open file-a end-exec. ...
    (comp.lang.cobol)
  • Re: Millions of Delete Statements
    ... You mention a cursor. ... Others have mentioned batching the commands, ... so I will throw out one that is less good (executing them ... get the whole SQL statement I don't know of another way to do it). ...
    (comp.databases.ms-sqlserver)
  • Re: Daten schnell lesen =?ISO-8859-1?Q?=28Gegenst=FCck_zu_BU?= =?ISO-8859-1?Q?LK_INS
    ... Damit meinte ich eine direkte Verarbeitung mittels ... 10maligem FETCH (näheres findest Du unter DECLARE CURSOR). ... Ein DataReader in einer SQL Server Assembly ist ... Anweisungen auf dem Server erledigt werden kann. ...
    (microsoft.public.de.sqlserver)