Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Integer Paramater Query - Syntax


Message #1 by "Andrew Watts" <andrew.c.watts@b...> on Sat, 24 Jun 2000 1:20:28
I would think this would work - but the SQL check says error near 
@toprows.
My non paramter query works fine.

CREATE PROCEDURE usp_processinfo
(
  @toprows  int=null
)
AS
IF  @toprows is not null or @toprows >0
Begin


SELECT TOP  @toprows [processinfo]   FROM [vaultProcess] 
where ( LEFT ([processinfo],2)=' u' OR ErrorMessage is not NULL)
order by [EntryDate] DESC,[ErrorMessage]
    
End

else
Begin

SELECT * FROM [vaultProcess] 
where ( LEFT ([processinfo],2)=' u' OR ErrorMessage is not NULL)
order by [EntryDate] DESC,[ErrorMessage]


End 

  Return to Index