SET DATEFORMAT ymd;
ALTER PROCEDURE XSPS_EVENTS_SHIPPERS 'SMEDIT','2011-07-01' ,'2011-07-31'
@CPNYID AS VARCHAR(15),
@FECHAINI AS VARCHAR(10),
@FECHAFIN AS VARCHAR(10)
AS
/*
*/
DECLARE @SQL VARCHAR(400)
SET @SQL = 'SELECT * FROM '
SET @SQL = @SQL + RTRIM(@CPNYID) +'.DBO.XVR_EVENTS_SHIPPERS '
SET @SQL = @SQL + 'WHERE EventTime BETWEEN '''+ @FECHAINI+''' AND ''' +@FECHAFIN+''' Order by EventTime asc'
print @SQL
EXEC (@SQL)
No hay comentarios:
Publicar un comentario