-----need help with stored proc---PLEASE 
Author Message
 -----need help with stored proc---PLEASE

the following procedure is giving me fits. it tells me d_t is an invalid
field. I've simplified this getting rid of the control-flow structure and no
matter what I do I get the same syntax error.

Create Procedure checkblackball

AS

BEGIN
 IF (dateadd(day,-d_t,GETDATE())) < 24
  RETURN  1
 ELSE
 BEGIN

  RETURN
 END

END
RETURN

even if I get rid of everything and just compare the field I get the same
error. I've checked all the obvious things. Please don't answer that I
should make sure that is the correct field name.
Thanks in advance,

Ken Corley
Space Age Services, Inc.



Sun, 12 May 2002 03:00:00 GMT
 -----need help with stored proc---PLEASE

Heya, Ken!

From what I can tell, d_t is *not* being used in context of a table with
your DATEADD function.  As such, the parser can't determine what it is,
hence the error.

I don't know if you're trying to update every field in the table or just



  from tblBlackBall


   begin

      begin
      return 1
      end
   else
      begin
      delete tblBlackball

      end
   end

Hope this helps!

John Peterson


Quote:
> the following procedure is giving me fits. it tells me d_t is an invalid
> field. I've simplified this getting rid of the control-flow structure and
no
> matter what I do I get the same syntax error.

> Create Procedure checkblackball

> AS

> BEGIN
>  IF (dateadd(day,-d_t,GETDATE())) < 24
>   RETURN  1
>  ELSE
>  BEGIN

>   RETURN
>  END

> END
> RETURN

> even if I get rid of everything and just compare the field I get the same
> error. I've checked all the obvious things. Please don't answer that I
> should make sure that is the correct field name.
> Thanks in advance,

> Ken Corley
> Space Age Services, Inc.



Sun, 12 May 2002 03:00:00 GMT
 -----need help with stored proc---PLEASE
The line
IF (dateadd(day,-d_t,GETDATE())) < 24
looks like the one.


it comes from a table, SQL Server needs to be told which one.

Hope that's the kind of answer you wanted.

Regards

David Prebble

Quote:

>the following procedure is giving me fits. it tells me d_t is an invalid
>field. I've simplified this getting rid of the control-flow structure and
no
>matter what I do I get the same syntax error.

>Create Procedure checkblackball

>AS

>BEGIN
> IF (dateadd(day,-d_t,GETDATE())) < 24
>  RETURN  1
> ELSE
> BEGIN

>  RETURN
> END

>END
>RETURN

>even if I get rid of everything and just compare the field I get the same
>error. I've checked all the obvious things. Please don't answer that I
>should make sure that is the correct field name.
>Thanks in advance,

>Ken Corley
>Space Age Services, Inc.



Sun, 12 May 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Need Help on Dynamic Stored Proc Call within Stored Proc w/OUTPUT

2. Advice needed on stored proc please!

3. ADO Stored Proc...AAAAAAAAAAAARRG please help

4. please help stored proc issue

5. Stored Proc Date conversion Problem, Please Help

6. calling Stored Proc with InputOutput params - help please!

7. !!!! PLEASE HELP ::stored proc call dies with ODBC

8. Please Help, Nested stored proc is inconsitent

9. Please Help with Stored Proc

10. PLEASE HELP - stored proc

11. calling Stored Proc with InputOutput params - help please!

12. PLEASE HELP - Dynamic SQL in a stored proc


 
Powered by phpBB® Forum Software