I have a table dbo.X with DateTime column Y which may have hundreds of records.
dbo.X
DateTime
column Y
My Stored Procedure has parameter @Curre
@Curre
CREATE PROCEDURE CurrentDate @CurrentDate DATETIME AS BEGIN Select * from orders where OrderDate < @CurrentDate END GO