CREATE PROCEDURE sp_IndexChart
(
@von date,
@bis date,
@Index nvarchar(255),
@UserName varchar(50)
)
AS
BEGIN
SET NOCOUNT ON;
--Delete
BEGIN
DELETE FROM tblIndexTmp WHERE UserName = @UserName
END
--tblIndexTmp
INSERT INTO tblIndexTmp
(Datum, MainIndex,Stand,UserName)
SELECT Datum,MainIndex,Stand, @UserName
FROM tblIndexArchiv
WHERE (Datum BETWEEN @von -1 AND @bis)
END
|