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/41/4113d17d819c20a18f64e3136d3...

45 lines
4.5 KiB

USE [Vertragsverwaltung_20160404]
GO
/****** Object: StoredProcedure [dbo].[pr_ApplikationLogbuch_SelectAll_bottomtable] Script Date: 02.12.2016 09:08:54 ******/
DROP PROCEDURE [dbo].[pr_ApplikationLogbuch_SelectAll_bottomtable]
GO
/****** Object: StoredProcedure [dbo].[pr_ApplikationLogbuch_SelectAll_bottomtable] Script Date: 02.12.2016 09:08:54 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[pr_ApplikationLogbuch_SelectAll_bottomtable]
---------------------------------------------------------------------------------
-- Stored procedure that will select all rows from the table 'Applikationkontakt'
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
@iErrorCode int OUTPUT,
@Fokus int,
@KeyValue int,
@mitarbeiternr int
AS
SET NOCOUNT ON
-- SELECT all rows from the table.
SELECT dbo.ApplikationLogbuch.ApplikationLogbuchNr, dbo.ApplikationLogbuch.Releasedatum, dbo.ApplikationLogbuch.Bezeichnung, dbo.ReleaseArt.Bezeichnung AS Releaseart,
Person_1.Name + ' ' + Person_1.Vorname AS AbnahmeFB, dbo.Person.Name + ' ' + Person.Vorname AS AbnahmeTec,
Person_2.Name + ' ' + Person_2.Vorname AS Freigabedurch, dbo.ApplikationLogbuch.AbnahmeFBDatum, dbo.ApplikationLogbuch.AbnahmeTecDatum,
dbo.ApplikationLogbuch.FreigabeDatum, dbo.ApplikationLogbuch.Aktiv, dbo.ApplikationLogbuch.Erstellt_am, dbo.ApplikationLogbuch.Mutiert_am,
dbo.ApplikationLogbuch.Mutierer, dbo.ApplikationLogbuch.ApplikationNr
FROM dbo.Person AS Person_1 RIGHT OUTER JOIN
dbo.Person RIGHT OUTER JOIN
dbo.ApplikationLogbuch INNER JOIN
dbo.ReleaseArt ON dbo.ApplikationLogbuch.Releaseartnr = dbo.ReleaseArt.Releaseartnr LEFT OUTER JOIN
dbo.Person AS Person_2 ON dbo.ApplikationLogbuch.Freigabedurch = Person_2.PersonNr ON dbo.Person.PersonNr = dbo.ApplikationLogbuch.AbnahmeTecPerson ON
Person_1.PersonNr = dbo.ApplikationLogbuch.AbnahmeFBPerson
WHERE dbo.ApplikationLogbuch.ApplikationNr = @keyvalue
ORDER BY
[Releasedatum] desc
SELECT @iErrorCode=@@ERROR
GO