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.
52 lines
5.3 KiB
52 lines
5.3 KiB
USE [Vertragsverwaltung_20160404]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_SelectAll_Bottomtable] Script Date: 02.12.2016 09:08:54 ******/
|
|
DROP PROCEDURE [dbo].[pr_funktionsgruppe_rolle_SelectAll_Bottomtable]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_SelectAll_Bottomtable] Script Date: 02.12.2016 09:08:54 ******/
|
|
SET ANSI_NULLS OFF
|
|
GO
|
|
SET QUOTED_IDENTIFIER OFF
|
|
GO
|
|
|
|
---------------------------------------------------------------------------------
|
|
-- Stored procedure that will select all rows from the table 'funktionsgruppe_rolle'
|
|
-- Returns: @iErrorCode int
|
|
---------------------------------------------------------------------------------
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_rolle_SelectAll_Bottomtable]
|
|
@iErrorCode int OUTPUT,
|
|
@Fokus int,
|
|
@KeyValue int
|
|
AS
|
|
SET NOCOUNT ON
|
|
|
|
if @fokus = 1 begin
|
|
SELECT dbo.funktionsgruppe_rolle.Funktionsgrupperollenr, dbo.funktionsgruppe_rolle.funktionsgruppenr,
|
|
dbo.funktionsgruppe.bezeichnung AS Funktion, dbo.funktionsgruppe_rolle.rollenr, dbo.rolle.bezeichnung AS Rolle,
|
|
dbo.funktionsgruppe_rolle.mandantnr, dbo.funktionsgruppe_rolle.aktiv, dbo.funktionsgruppe_rolle.erstellt_am, dbo.funktionsgruppe_rolle.mutiert_am,
|
|
dbo.funktionsgruppe_rolle.mutierer
|
|
FROM dbo.funktionsgruppe_rolle INNER JOIN
|
|
dbo.funktionsgruppe ON dbo.funktionsgruppe_rolle.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
dbo.rolle ON dbo.funktionsgruppe_rolle.rollenr = dbo.rolle.rollenr
|
|
where funktionsgruppe_rolle.funktionsgruppenr=@keyvalue
|
|
ORDER BY dbo.funktionsgruppe_rolle.Funktionsgrupperollenr
|
|
end else begin
|
|
SELECT dbo.funktionsgruppe_rolle.Funktionsgrupperollenr, dbo.funktionsgruppe_rolle.funktionsgruppenr,
|
|
dbo.funktionsgruppe.bezeichnung AS Funktion, dbo.funktionsgruppe_rolle.rollenr, dbo.rolle.bezeichnung AS Rolle,
|
|
dbo.funktionsgruppe_rolle.mandantnr, dbo.funktionsgruppe_rolle.aktiv, dbo.funktionsgruppe_rolle.erstellt_am, dbo.funktionsgruppe_rolle.mutiert_am,
|
|
dbo.funktionsgruppe_rolle.mutierer
|
|
FROM dbo.funktionsgruppe_rolle INNER JOIN
|
|
dbo.funktionsgruppe ON dbo.funktionsgruppe_rolle.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
dbo.rolle ON dbo.funktionsgruppe_rolle.rollenr = dbo.rolle.rollenr
|
|
where funktionsgruppe_rolle.rollenr=@keyvalue
|
|
ORDER BY dbo.funktionsgruppe_rolle.Funktionsgrupperollenr
|
|
|
|
end
|
|
-- SELECT all rows from the table.
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
GO
|