/***** DATASET *****/
USE [DatabaseName]
GO
/****** Object: StoredProcedure [dbo].[MyStoredProcedure] Script Date: mm/dd/yyyy hh:mm:ss ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[MyStoredProcedure]
@fromDate datetime,
@toDate datetime
AS
BEGIN
DECLARE @@realToDate datetime
SET @@realToDate = dateadd(day, 1, @toDate)
Select ......... From ........ where LocalDateTime >= @fromDate and LocalDateTime < @@realToDate) .... order by ....
END
Luego podemos ejecutarlo así:
EXEC DatabaseName.dbo.MyStoredProcedure @fromDate='08/10/2009', @toDate='08/10/2009'
No hay comentarios:
Publicar un comentario