[dba-SQLServer]Weird error message

Djabarov, Robert Robert.Djabarov at usaa.com
Wed Feb 4 17:11:37 CST 2004


Are there any DATETIME fields in tblOrder table?  It's obviously
data-related, but not necessarily is barking at the fields referenced in
the function.

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy
Pang
Sent: Wednesday, February 04, 2004 4:51 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer]Weird error message


CREATE FUNCTION udf_show_this (@tblOrder_ID INT) RETURNS VARCHAR(8000)
AS BEGIN

   DECLARE @strMsg VARCHAR(8000)
   DECLARE @i TINYINT
   SET @i = 0
   SELECT @strMsg = 'x' + CAST(@tblOrder_ID AS VARCHAR(8)) + 'x', 
@tblOrder_ID = tblOrder_fk_ID FROM tblOrder WHERE tblOrder_ID =
@tblOrder_ID

   WHILE @tblOrder_ID <> 0
      BEGIN
         SET @i = @i + 1
         SELECT @strMsg = 'x' + CAST(tblOrder_ID AS VARCHAR(8)) +
@strMsg, 
@tblOrder_ID = tblOrder_fk_ID FROM tblOrder WITH (NOLOCK) WHERE
tblOrder_ID 
= @tblOrder_ID
         IF @i > 10
            BREAK
      END
   RETURN (@strMsg)
END

GO


>From: "Djabarov, Robert" <Robert.Djabarov at usaa.com>
>Reply-To: dba-sqlserver at databaseadvisors.com
>To: <dba-sqlserver at databaseadvisors.com>
>Subject: RE: [dba-SQLServer]Weird error message
>Date: Wed, 4 Feb 2004 14:59:13 -0600
>
>Can you post the function?
>
>-----Original Message-----
>From: dba-sqlserver-bounces at databaseadvisors.com
>[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Billy 
>Pang
>Sent: Wednesday, February 04, 2004 1:32 PM
>To: dba-SQLServer at databaseadvisors.com
>Subject: [dba-SQLServer]Weird error message
>
>
>Has anyone ever received the following error message before?  It occurs

>sporadicaly in my function but the funny thing is, I don't even have a 
>datetime var in my function.
>
>Server: Msg 542, Level 16, State 1, Procedure udf_show_this, Line 8 An 
>invalid datetime value was encountered. Value exceeds the year 9999.
>
>Thanks in advance,
>Billy
>
>_________________________________________________________________
>MSN 8 with e-mail virus protection service: 2 months FREE* 
>http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2
>f
>join.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com
>

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



More information about the dba-SQLServer mailing list