Re: Timing out????

From: Narayana Vyas Kondreddi (answer_me_at_hotmail.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 16:44:25 +0100

You don't have to replace T and L. They are just aliases to the actual table
names. Makes it easy to distinguish columns with same names, but from
different tables. Also good from a readability and coding point of view.

When I wrote that code, I didn't know the column name from tbDateDiff. Just
replace T.IP with T.ActualColumnName and it should work.

-- 
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:u%23SEaWSXEHA.712@TK2MSFTNGP11.phx.gbl...
Should the 'T' in T.IP  or the 'L' in the code be replaced with something? I
am very new here and don't understand the lingo to some perhaps known
replacement nomenclature... I copied and pasted the code and got errors back
when I tried to save the sp.
Server: Msg 207, Level 16, State 3, Procedure sp_CleanUp, Line 5
Invalid column name 'IP'.
thanks
Ralph
"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
>
>
>