You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ITSM/.svn/pristine/19/19b6c70e51b874b74f63e1e7650...

41 lines
3.5 KiB

USE [Vertragsverwaltung_20160404]
GO
/****** Object: StoredProcedure [dbo].[pr_History_SelectAll_bottomtable] Script Date: 02.12.2016 09:08:54 ******/
DROP PROCEDURE [dbo].[pr_History_SelectAll_bottomtable]
GO
/****** Object: StoredProcedure [dbo].[pr_History_SelectAll_bottomtable] Script Date: 02.12.2016 09:08:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
---------------------------------------------------------------------------------
-- Stored procedure that will select all rows from the table 'History for a Vertragselement (Typ=1)'
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_History_SelectAll_bottomtable]
---------------------------------------------------------------------------------
-- Stored procedure that will select all rows from the table 'History for a Vertragselement (Typ=1)'
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
@iErrorCode int OUTPUT,
@Fokus int,
@KeyValue int,
@mitarbeiternr int
AS
SET NOCOUNT ON
-- SELECT all rows from the table.
SELECT dbo.History.HistoryNr, dbo.HistoryTyp.Historytypnr, dbo.HistoryTyp.Bezeichnung, dbo.History.HistoryObject, dbo.History.HistoryObjekctKey,
dbo.History.HistoryObjectDetails, dbo.History.Alter_Wert, dbo.History.Neuer_Wert, dbo.History.Erstellt_am, dbo.History.Mutierer
FROM dbo.HistoryTyp INNER JOIN
dbo.History ON dbo.HistoryTyp.Historytypnr = dbo.History.HistoryTypNr
where dbo.history.historytypnr=1 and dbo.history.HistoryObjekctKey=@keyvalue
order by dbo.history.Erstellt_am desc
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO