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