|
|
USE [TIM]
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[my_mitarbeiter_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'mitarbeiter' including combined Filed using Name, Vorname, TGNummer
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[my_mitarbeiter_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT *,
|
|
|
[Name] + ' '+ [Vorname] + ', ' + [TGNummer] as Fullname
|
|
|
FROM [dbo].[mitarbeiter]
|
|
|
where aktiv=1
|
|
|
ORDER BY
|
|
|
[mitarbeiternr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[my_mitarbeiter_SelectWithTGNummer] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'mitarbeiter'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[my_mitarbeiter_SelectWithTGNummer]
|
|
|
@stgnummer varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
SELECT *
|
|
|
|
|
|
FROM [dbo].[mitarbeiter]
|
|
|
WHERE
|
|
|
aktiv=1 and tgnummer=@stgnummer
|
|
|
ORDER BY
|
|
|
[mitarbeiternr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[my_security_check_entry] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[my_security_check_entry]
|
|
|
@form varchar(255),
|
|
|
@objecttype varchar(255),
|
|
|
@object varchar(255),
|
|
|
@objectitem varchar(255),
|
|
|
@objexists int output
|
|
|
AS
|
|
|
SELECT SecurityForm, SecurityObjectType, SecurityObject, SecurityObjectItem, Aktiv
|
|
|
FROM dbo.SecurityObject
|
|
|
WHERE SecurityForm=@form and securityobjecttype=@objecttype and securityobject=@object and securityobjectitem=@objectitem and aktiv=1
|
|
|
set @objexists=@@rowcount
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[my_security_get_data] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[my_security_get_data]
|
|
|
@formname varchar(255),
|
|
|
@mitarbeiternr int
|
|
|
as
|
|
|
|
|
|
SELECT DISTINCT
|
|
|
dbo.SecurityObject.SecurityObjectNr, dbo.SecurityObject.SecurityForm, dbo.SecurityObject.SecurityObjectType, dbo.SecurityObject.SecurityObject,
|
|
|
dbo.SecurityObject.SecurityObjectItem, dbo.SecurityObject.Aktiv, dbo.Rolle_SecurityObject.readonly, dbo.Rolle_SecurityObject.invisible,
|
|
|
dbo.mitarbeiter_funktionsgruppe.mitarbeiternr
|
|
|
FROM dbo.Rolle_SecurityObject INNER JOIN
|
|
|
dbo.rolle ON dbo.Rolle_SecurityObject.rollenr = dbo.rolle.rollenr INNER JOIN
|
|
|
dbo.funktionsgruppe_rolle ON dbo.rolle.rollenr = dbo.funktionsgruppe_rolle.rollenr INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.funktionsgruppe_rolle.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
|
dbo.SecurityObject ON dbo.Rolle_SecurityObject.securityobjectnr = dbo.SecurityObject.SecurityObjectNr INNER JOIN
|
|
|
dbo.mitarbeiter_funktionsgruppe ON dbo.funktionsgruppe.funktionsgruppenr = dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr
|
|
|
WHERE (dbo.SecurityObject.Aktiv = 1) AND (dbo.Rolle_SecurityObject.aktiv = 1) AND (dbo.rolle.aktiv = 1) AND (dbo.funktionsgruppe_rolle.aktiv = 1) AND
|
|
|
(dbo.funktionsgruppe.aktiv = 1) AND (dbo.mitarbeiter_funktionsgruppe.aktiv = 1) AND (dbo.mitarbeiter_funktionsgruppe.mitarbeiternr = @mitarbeiternr) and dbo.SecurityObject.SecurityForm=@formname
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[my_tooltip_get_data] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[my_tooltip_get_data]
|
|
|
AS
|
|
|
BEGIN
|
|
|
SET NOCOUNT ON;
|
|
|
select * from tooltip where aktiv=1
|
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Application_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Application'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iapplikationsnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Application_Delete]
|
|
|
@iapplikationsnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Application]
|
|
|
WHERE
|
|
|
[applikationsnr] = @iapplikationsnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Application_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Application'
|
|
|
-- Gets: @iapplikationsnr int
|
|
|
-- Gets: @sversion varchar(4)
|
|
|
-- Gets: @bshowlogin bit
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @stmp_filepath varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Application_Insert]
|
|
|
@iapplikationsnr int,
|
|
|
@sversion varchar(4),
|
|
|
@bshowlogin bit,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@stmp_filepath varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Application]
|
|
|
(
|
|
|
[applikationsnr],
|
|
|
[version],
|
|
|
[showlogin],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[tmp_filepath]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iapplikationsnr,
|
|
|
@sversion,
|
|
|
@bshowlogin,
|
|
|
@imandantnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer,
|
|
|
@stmp_filepath
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Application_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Application'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Application_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[applikationsnr],
|
|
|
[version],
|
|
|
[showlogin],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[tmp_filepath]
|
|
|
FROM [dbo].[Application]
|
|
|
ORDER BY
|
|
|
[applikationsnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Application_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Application'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iapplikationsnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Application_SelectOne]
|
|
|
@iapplikationsnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[applikationsnr],
|
|
|
[version],
|
|
|
[showlogin],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[tmp_filepath]
|
|
|
FROM [dbo].[Application]
|
|
|
WHERE
|
|
|
[applikationsnr] = @iapplikationsnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Application_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Application'
|
|
|
-- Gets: @iapplikationsnr int
|
|
|
-- Gets: @sversion varchar(4)
|
|
|
-- Gets: @bshowlogin bit
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @stmp_filepath varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Application_Update]
|
|
|
@iapplikationsnr int,
|
|
|
@sversion varchar(4),
|
|
|
@bshowlogin bit,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@stmp_filepath varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Application]
|
|
|
SET
|
|
|
[version] = @sversion,
|
|
|
[showlogin] = @bshowlogin,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer,
|
|
|
[tmp_filepath] = @stmp_filepath
|
|
|
WHERE
|
|
|
[applikationsnr] = @iapplikationsnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertung_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Auswertung'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iAuswertungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertung_Delete]
|
|
|
@iAuswertungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Auswertung]
|
|
|
WHERE
|
|
|
[AuswertungNr] = @iAuswertungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertung_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Auswertung'
|
|
|
-- Gets: @iAuswertungNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bReport bit
|
|
|
-- Gets: @sFilename varchar(255)
|
|
|
-- Gets: @bExcel_Report bit
|
|
|
-- Gets: @sSQL varchar(1024)
|
|
|
-- Gets: @sSQLType varchar(50)
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @sConnectionstring_Subreport varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertung_Insert]
|
|
|
@iAuswertungNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bReport bit,
|
|
|
@sFilename varchar(255),
|
|
|
@bExcel_Report bit,
|
|
|
@sSQL varchar(1024),
|
|
|
@sSQLType varchar(50),
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@sConnectionstring_Subreport varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Auswertung]
|
|
|
(
|
|
|
[AuswertungNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Report],
|
|
|
[Filename],
|
|
|
[Excel_Report],
|
|
|
[SQL],
|
|
|
[SQLType],
|
|
|
[Beschreibung],
|
|
|
[Connectionstring_Subreport]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iAuswertungNr,
|
|
|
@sBezeichnung,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@bReport,
|
|
|
@sFilename,
|
|
|
@bExcel_Report,
|
|
|
@sSQL,
|
|
|
@sSQLType,
|
|
|
@sBeschreibung,
|
|
|
@sConnectionstring_Subreport
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertung_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Auswertung'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertung_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[AuswertungNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Report],
|
|
|
[Filename],
|
|
|
[Excel_Report],
|
|
|
[SQL],
|
|
|
[SQLType],
|
|
|
[Beschreibung],
|
|
|
[Connectionstring_Subreport]
|
|
|
FROM [dbo].[Auswertung]
|
|
|
ORDER BY
|
|
|
[AuswertungNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertung_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Auswertung'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iAuswertungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertung_SelectOne]
|
|
|
@iAuswertungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[AuswertungNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Report],
|
|
|
[Filename],
|
|
|
[Excel_Report],
|
|
|
[SQL],
|
|
|
[SQLType],
|
|
|
[Beschreibung],
|
|
|
[Connectionstring_Subreport]
|
|
|
FROM [dbo].[Auswertung]
|
|
|
WHERE
|
|
|
[AuswertungNr] = @iAuswertungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertung_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Auswertung'
|
|
|
-- Gets: @iAuswertungNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bReport bit
|
|
|
-- Gets: @sFilename varchar(255)
|
|
|
-- Gets: @bExcel_Report bit
|
|
|
-- Gets: @sSQL varchar(1024)
|
|
|
-- Gets: @sSQLType varchar(50)
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @sConnectionstring_Subreport varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertung_Update]
|
|
|
@iAuswertungNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bReport bit,
|
|
|
@sFilename varchar(255),
|
|
|
@bExcel_Report bit,
|
|
|
@sSQL varchar(1024),
|
|
|
@sSQLType varchar(50),
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@sConnectionstring_Subreport varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Auswertung]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Report] = @bReport,
|
|
|
[Filename] = @sFilename,
|
|
|
[Excel_Report] = @bExcel_Report,
|
|
|
[SQL] = @sSQL,
|
|
|
[SQLType] = @sSQLType,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Connectionstring_Subreport] = @sConnectionstring_Subreport
|
|
|
WHERE
|
|
|
[AuswertungNr] = @iAuswertungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungAuswertungParameter_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'AuswertungAuswertungParameter'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iAuswertungAuswertungparameternr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungAuswertungParameter_Delete]
|
|
|
@iAuswertungAuswertungparameternr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[AuswertungAuswertungParameter]
|
|
|
WHERE
|
|
|
[AuswertungAuswertungparameternr] = @iAuswertungAuswertungparameternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungAuswertungParameter_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'AuswertungAuswertungParameter'
|
|
|
-- Gets: @iAuswertungAuswertungparameternr int
|
|
|
-- Gets: @iAuswertungnr int
|
|
|
-- Gets: @iAuswertungparameternr int
|
|
|
-- Gets: @sDBfeldname varchar(255)
|
|
|
-- Gets: @iReihenfolge int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungAuswertungParameter_Insert]
|
|
|
@iAuswertungAuswertungparameternr int,
|
|
|
@iAuswertungnr int,
|
|
|
@iAuswertungparameternr int,
|
|
|
@sDBfeldname varchar(255),
|
|
|
@iReihenfolge int,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[AuswertungAuswertungParameter]
|
|
|
(
|
|
|
[AuswertungAuswertungparameternr],
|
|
|
[Auswertungnr],
|
|
|
[Auswertungparameternr],
|
|
|
[DBfeldname],
|
|
|
[Reihenfolge],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iAuswertungAuswertungparameternr,
|
|
|
@iAuswertungnr,
|
|
|
@iAuswertungparameternr,
|
|
|
@sDBfeldname,
|
|
|
@iReihenfolge,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungAuswertungParameter_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'AuswertungAuswertungParameter'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungAuswertungParameter_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[AuswertungAuswertungparameternr],
|
|
|
[Auswertungnr],
|
|
|
[Auswertungparameternr],
|
|
|
[DBfeldname],
|
|
|
[Reihenfolge],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[AuswertungAuswertungParameter]
|
|
|
ORDER BY
|
|
|
[AuswertungAuswertungparameternr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungAuswertungParameter_SelectAll_Bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
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_AuswertungAuswertungParameter_SelectAll_Bottomtable]
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
|
|
|
if @fokus = 1 begin
|
|
|
SELECT dbo.AuswertungAuswertungParameter.AuswertungAuswertungparameternr, dbo.AuswertungAuswertungParameter.Auswertungnr,
|
|
|
dbo.Auswertung.Bezeichnung AS Auswertung, dbo.AuswertungAuswertungParameter.Auswertungparameternr, dbo.Auswertungsparameter.Bezeichnung AS Parameter,
|
|
|
dbo.AuswertungAuswertungParameter.DBfeldname, dbo.AuswertungAuswertungParameter.Reihenfolge,
|
|
|
dbo.AuswertungAuswertungParameter.Aktiv, dbo.AuswertungAuswertungParameter.Erstellt_am, dbo.AuswertungAuswertungParameter.Mutiert_am,
|
|
|
dbo.AuswertungAuswertungParameter.Mutierer
|
|
|
FROM dbo.Auswertungsparameter INNER JOIN
|
|
|
dbo.AuswertungAuswertungParameter ON
|
|
|
dbo.Auswertungsparameter.Auswertungparameternr = dbo.AuswertungAuswertungParameter.Auswertungparameternr INNER JOIN
|
|
|
dbo.Auswertung ON dbo.AuswertungAuswertungParameter.Auswertungnr = dbo.Auswertung.AuswertungNr
|
|
|
where auswertungauswertungparameter.auswertungnr=@keyvalue
|
|
|
ORDER BY dbo.auswertungauswertungparameter.auswertungauswertungparameternr
|
|
|
end else begin
|
|
|
SELECT dbo.AuswertungAuswertungParameter.AuswertungAuswertungparameternr, dbo.AuswertungAuswertungParameter.Auswertungnr,
|
|
|
dbo.Auswertung.Bezeichnung AS Auswertung, dbo.AuswertungAuswertungParameter.Auswertungparameternr, dbo.Auswertungsparameter.Bezeichnung AS Parameter,
|
|
|
dbo.AuswertungAuswertungParameter.DBfeldname,dbo.AuswertungAuswertungParameter.Reihenfolge,
|
|
|
dbo.AuswertungAuswertungParameter.Aktiv, dbo.AuswertungAuswertungParameter.Erstellt_am, dbo.AuswertungAuswertungParameter.Mutiert_am,
|
|
|
dbo.AuswertungAuswertungParameter.Mutierer
|
|
|
FROM dbo.Auswertungsparameter INNER JOIN
|
|
|
dbo.AuswertungAuswertungParameter ON
|
|
|
dbo.Auswertungsparameter.Auswertungparameternr = dbo.AuswertungAuswertungParameter.Auswertungparameternr INNER JOIN
|
|
|
dbo.Auswertung ON dbo.AuswertungAuswertungParameter.Auswertungnr = dbo.Auswertung.AuswertungNr
|
|
|
where auswertungauswertungparameter.auswertungparameternr=@keyvalue
|
|
|
ORDER BY dbo.auswertungauswertungparameter.auswertungauswertungparameternr
|
|
|
|
|
|
end
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
/****** Objekt: StoredProcedure [dbo].[pr_rfcboard_mitarbeiter_SelectAll_Bottomtable] Skriptdatum: 03/31/2009 16:59:11 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungAuswertungParameter_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'AuswertungAuswertungParameter'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iAuswertungAuswertungparameternr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungAuswertungParameter_SelectOne]
|
|
|
@iAuswertungAuswertungparameternr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[AuswertungAuswertungparameternr],
|
|
|
[Auswertungnr],
|
|
|
[Auswertungparameternr],
|
|
|
[DBfeldname],
|
|
|
[Reihenfolge],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[AuswertungAuswertungParameter]
|
|
|
WHERE
|
|
|
[AuswertungAuswertungparameternr] = @iAuswertungAuswertungparameternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungAuswertungParameter_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'AuswertungAuswertungParameter'
|
|
|
-- Gets: @iAuswertungAuswertungparameternr int
|
|
|
-- Gets: @iAuswertungnr int
|
|
|
-- Gets: @iAuswertungparameternr int
|
|
|
-- Gets: @sDBfeldname varchar(255)
|
|
|
-- Gets: @iReihenfolge int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungAuswertungParameter_Update]
|
|
|
@iAuswertungAuswertungparameternr int,
|
|
|
@iAuswertungnr int,
|
|
|
@iAuswertungparameternr int,
|
|
|
@sDBfeldname varchar(255),
|
|
|
@iReihenfolge int,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[AuswertungAuswertungParameter]
|
|
|
SET
|
|
|
[Auswertungnr] = @iAuswertungnr,
|
|
|
[Auswertungparameternr] = @iAuswertungparameternr,
|
|
|
[DBfeldname] = @sDBfeldname,
|
|
|
[Reihenfolge] = @iReihenfolge,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[AuswertungAuswertungparameternr] = @iAuswertungAuswertungparameternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppe_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'AuswertungGruppe'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppe_Delete]
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[AuswertungGruppe]
|
|
|
WHERE
|
|
|
[AuswertungGruppeNr] = @iAuswertungGruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppe_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'AuswertungGruppe'
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iParentid int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppe_Insert]
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iParentid int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[AuswertungGruppe]
|
|
|
(
|
|
|
[AuswertungGruppeNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Parentid]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iAuswertungGruppeNr,
|
|
|
@sBezeichnung,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@iParentid
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppe_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'AuswertungGruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppe_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[AuswertungGruppeNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Parentid]
|
|
|
FROM [dbo].[AuswertungGruppe]
|
|
|
ORDER BY
|
|
|
[AuswertungGruppeNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppe_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'AuswertungGruppe'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppe_SelectOne]
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[AuswertungGruppeNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Parentid]
|
|
|
FROM [dbo].[AuswertungGruppe]
|
|
|
WHERE
|
|
|
[AuswertungGruppeNr] = @iAuswertungGruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppe_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'AuswertungGruppe'
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iParentid int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppe_Update]
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iParentid int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[AuswertungGruppe]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Parentid] = @iParentid
|
|
|
WHERE
|
|
|
[AuswertungGruppeNr] = @iAuswertungGruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppeAuswertung_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'AuswertungGruppeAuswertung'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iAuswertungGruppeAuswertungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppeAuswertung_Delete]
|
|
|
@iAuswertungGruppeAuswertungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[AuswertungGruppeAuswertung]
|
|
|
WHERE
|
|
|
[AuswertungGruppeAuswertungNr] = @iAuswertungGruppeAuswertungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppeAuswertung_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'AuswertungGruppeAuswertung'
|
|
|
-- Gets: @iAuswertungGruppeAuswertungNr int
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Gets: @iAuswertungNr int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstllt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppeAuswertung_Insert]
|
|
|
@iAuswertungGruppeAuswertungNr int,
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@iAuswertungNr int,
|
|
|
@bAktiv bit,
|
|
|
@daErstllt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[AuswertungGruppeAuswertung]
|
|
|
(
|
|
|
[AuswertungGruppeAuswertungNr],
|
|
|
[AuswertungGruppeNr],
|
|
|
[AuswertungNr],
|
|
|
[Aktiv],
|
|
|
[Erstllt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iAuswertungGruppeAuswertungNr,
|
|
|
@iAuswertungGruppeNr,
|
|
|
@iAuswertungNr,
|
|
|
@bAktiv,
|
|
|
@daErstllt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppeAuswertung_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'AuswertungGruppeAuswertung'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppeAuswertung_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[AuswertungGruppeAuswertungNr],
|
|
|
[AuswertungGruppeNr],
|
|
|
[AuswertungNr],
|
|
|
[Aktiv],
|
|
|
[Erstllt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[AuswertungGruppeAuswertung]
|
|
|
ORDER BY
|
|
|
[AuswertungGruppeAuswertungNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppeAuswertung_SelectAll_Bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
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_AuswertungGruppeAuswertung_SelectAll_Bottomtable]
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
|
|
|
if @fokus = 1 begin
|
|
|
SELECT dbo.AuswertungGruppeAuswertung.AuswertungGruppeAuswertungNr, dbo.AuswertungGruppeAuswertung.AuswertungGruppeNr,
|
|
|
dbo.AuswertungGruppe.Bezeichnung AS Gruppe, dbo.AuswertungGruppeAuswertung.AuswertungNr, dbo.Auswertung.Bezeichnung AS Auswertung,
|
|
|
dbo.AuswertungGruppeAuswertung.Aktiv, dbo.AuswertungGruppeAuswertung.Erstllt_am, dbo.AuswertungGruppeAuswertung.Mutiert_am,
|
|
|
dbo.AuswertungGruppeAuswertung.Mutierer
|
|
|
FROM dbo.AuswertungGruppeAuswertung INNER JOIN
|
|
|
dbo.AuswertungGruppe ON dbo.AuswertungGruppeAuswertung.AuswertungGruppeNr = dbo.AuswertungGruppe.AuswertungGruppeNr INNER JOIN
|
|
|
dbo.Auswertung ON dbo.AuswertungGruppeAuswertung.AuswertungNr = dbo.Auswertung.AuswertungNr
|
|
|
where auswertunggruppeauswertung.auswertunggruppenr=@keyvalue
|
|
|
ORDER BY dbo.auswertunggruppeauswertung.auswertunggruppenr
|
|
|
end else begin
|
|
|
SELECT dbo.AuswertungGruppeAuswertung.AuswertungGruppeAuswertungNr, dbo.AuswertungGruppeAuswertung.AuswertungGruppeNr,
|
|
|
dbo.AuswertungGruppe.Bezeichnung AS Gruppe, dbo.AuswertungGruppeAuswertung.AuswertungNr, dbo.Auswertung.Bezeichnung AS Auswertung,
|
|
|
dbo.AuswertungGruppeAuswertung.Aktiv, dbo.AuswertungGruppeAuswertung.Erstllt_am, dbo.AuswertungGruppeAuswertung.Mutiert_am,
|
|
|
dbo.AuswertungGruppeAuswertung.Mutierer
|
|
|
FROM dbo.AuswertungGruppeAuswertung INNER JOIN
|
|
|
dbo.AuswertungGruppe ON dbo.AuswertungGruppeAuswertung.AuswertungGruppeNr = dbo.AuswertungGruppe.AuswertungGruppeNr INNER JOIN
|
|
|
dbo.Auswertung ON dbo.AuswertungGruppeAuswertung.AuswertungNr = dbo.Auswertung.AuswertungNr
|
|
|
where auswertunggruppeauswertung.auswertungnr=@keyvalue
|
|
|
ORDER BY dbo.auswertunggruppeauswertung.auswertunggruppenr
|
|
|
|
|
|
end
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppeAuswertung_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'AuswertungGruppeAuswertung'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iAuswertungGruppeAuswertungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppeAuswertung_SelectOne]
|
|
|
@iAuswertungGruppeAuswertungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[AuswertungGruppeAuswertungNr],
|
|
|
[AuswertungGruppeNr],
|
|
|
[AuswertungNr],
|
|
|
[Aktiv],
|
|
|
[Erstllt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[AuswertungGruppeAuswertung]
|
|
|
WHERE
|
|
|
[AuswertungGruppeAuswertungNr] = @iAuswertungGruppeAuswertungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungGruppeAuswertung_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'AuswertungGruppeAuswertung'
|
|
|
-- Gets: @iAuswertungGruppeAuswertungNr int
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Gets: @iAuswertungNr int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstllt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungGruppeAuswertung_Update]
|
|
|
@iAuswertungGruppeAuswertungNr int,
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@iAuswertungNr int,
|
|
|
@bAktiv bit,
|
|
|
@daErstllt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[AuswertungGruppeAuswertung]
|
|
|
SET
|
|
|
[AuswertungGruppeNr] = @iAuswertungGruppeNr,
|
|
|
[AuswertungNr] = @iAuswertungNr,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstllt_am] = @daErstllt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[AuswertungGruppeAuswertungNr] = @iAuswertungGruppeAuswertungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungRptDatei_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'AuswertungRptDatei'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iAuswertungDateiNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungRptDatei_Delete]
|
|
|
@iAuswertungDateiNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[AuswertungRptDatei]
|
|
|
WHERE
|
|
|
[AuswertungDateiNr] = @iAuswertungDateiNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungRptDatei_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'AuswertungRptDatei'
|
|
|
-- Gets: @iAuswertungDateiNr int
|
|
|
-- Gets: @sFilename varchar(255)
|
|
|
-- Gets: @sReportname varchar(50)
|
|
|
-- Gets: @blobReportfile image
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungRptDatei_Insert]
|
|
|
@iAuswertungDateiNr int,
|
|
|
@sFilename varchar(255),
|
|
|
@sReportname varchar(50),
|
|
|
@blobReportfile image,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[AuswertungRptDatei]
|
|
|
(
|
|
|
[AuswertungDateiNr],
|
|
|
[Filename],
|
|
|
[Reportname],
|
|
|
[Reportfile],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iAuswertungDateiNr,
|
|
|
@sFilename,
|
|
|
@sReportname,
|
|
|
@blobReportfile,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungRptDatei_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'AuswertungRptDatei'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungRptDatei_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[AuswertungDateiNr],
|
|
|
[Filename],
|
|
|
[Reportname],
|
|
|
[Reportfile],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[AuswertungRptDatei]
|
|
|
ORDER BY
|
|
|
[AuswertungDateiNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungRptDatei_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'AuswertungRptDatei'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iAuswertungDateiNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungRptDatei_SelectOne]
|
|
|
@iAuswertungDateiNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[AuswertungDateiNr],
|
|
|
[Filename],
|
|
|
[Reportname],
|
|
|
[Reportfile],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[AuswertungRptDatei]
|
|
|
WHERE
|
|
|
[AuswertungDateiNr] = @iAuswertungDateiNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_AuswertungRptDatei_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'AuswertungRptDatei'
|
|
|
-- Gets: @iAuswertungDateiNr int
|
|
|
-- Gets: @sFilename varchar(255)
|
|
|
-- Gets: @sReportname varchar(50)
|
|
|
-- Gets: @blobReportfile image
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_AuswertungRptDatei_Update]
|
|
|
@iAuswertungDateiNr int,
|
|
|
@sFilename varchar(255),
|
|
|
@sReportname varchar(50),
|
|
|
@blobReportfile image,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[AuswertungRptDatei]
|
|
|
SET
|
|
|
[Filename] = @sFilename,
|
|
|
[Reportname] = @sReportname,
|
|
|
[Reportfile] = @blobReportfile,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[AuswertungDateiNr] = @iAuswertungDateiNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertungsparameter_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Auswertungsparameter'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iAuswertungparameternr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertungsparameter_Delete]
|
|
|
@iAuswertungparameternr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Auswertungsparameter]
|
|
|
WHERE
|
|
|
[Auswertungparameternr] = @iAuswertungparameternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertungsparameter_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Auswertungsparameter'
|
|
|
-- Gets: @iAuswertungparameternr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @sOperator varchar(50)
|
|
|
-- Gets: @sFeldbezug varchar(200)
|
|
|
-- Gets: @sWert varchar(50)
|
|
|
-- Gets: @sParamName varchar(50)
|
|
|
-- Gets: @sParamType varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bFix bit
|
|
|
-- Gets: @bVisible bit
|
|
|
-- Gets: @sDefaultvalue varchar(255)
|
|
|
-- Gets: @bEditable bit
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertungsparameter_Insert]
|
|
|
@iAuswertungparameternr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@sOperator varchar(50),
|
|
|
@sFeldbezug varchar(200),
|
|
|
@sWert varchar(50),
|
|
|
@sParamName varchar(50),
|
|
|
@sParamType varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bFix bit,
|
|
|
@bVisible bit,
|
|
|
@sDefaultvalue varchar(255),
|
|
|
@bEditable bit,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Auswertungsparameter]
|
|
|
(
|
|
|
[Auswertungparameternr],
|
|
|
[Bezeichnung],
|
|
|
[Operator],
|
|
|
[Feldbezug],
|
|
|
[Wert],
|
|
|
[ParamName],
|
|
|
[ParamType],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Fix],
|
|
|
[Visible],
|
|
|
[Defaultvalue],
|
|
|
[Editable]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iAuswertungparameternr,
|
|
|
@sBezeichnung,
|
|
|
@sOperator,
|
|
|
@sFeldbezug,
|
|
|
@sWert,
|
|
|
@sParamName,
|
|
|
@sParamType,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@bFix,
|
|
|
@bVisible,
|
|
|
@sDefaultvalue,
|
|
|
@bEditable
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertungsparameter_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Auswertungsparameter'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertungsparameter_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[Auswertungparameternr],
|
|
|
[Bezeichnung],
|
|
|
[Operator],
|
|
|
[Feldbezug],
|
|
|
[Wert],
|
|
|
[ParamName],
|
|
|
[ParamType],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Fix],
|
|
|
[Visible],
|
|
|
[Defaultvalue],
|
|
|
[Editable]
|
|
|
FROM [dbo].[Auswertungsparameter]
|
|
|
ORDER BY
|
|
|
[Auswertungparameternr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertungsparameter_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Auswertungsparameter'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iAuswertungparameternr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertungsparameter_SelectOne]
|
|
|
@iAuswertungparameternr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[Auswertungparameternr],
|
|
|
[Bezeichnung],
|
|
|
[Operator],
|
|
|
[Feldbezug],
|
|
|
[Wert],
|
|
|
[ParamName],
|
|
|
[ParamType],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Fix],
|
|
|
[Visible],
|
|
|
[Defaultvalue],
|
|
|
[Editable]
|
|
|
FROM [dbo].[Auswertungsparameter]
|
|
|
WHERE
|
|
|
[Auswertungparameternr] = @iAuswertungparameternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Auswertungsparameter_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Auswertungsparameter'
|
|
|
-- Gets: @iAuswertungparameternr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @sOperator varchar(50)
|
|
|
-- Gets: @sFeldbezug varchar(200)
|
|
|
-- Gets: @sWert varchar(50)
|
|
|
-- Gets: @sParamName varchar(50)
|
|
|
-- Gets: @sParamType varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bFix bit
|
|
|
-- Gets: @bVisible bit
|
|
|
-- Gets: @sDefaultvalue varchar(255)
|
|
|
-- Gets: @bEditable bit
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Auswertungsparameter_Update]
|
|
|
@iAuswertungparameternr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@sOperator varchar(50),
|
|
|
@sFeldbezug varchar(200),
|
|
|
@sWert varchar(50),
|
|
|
@sParamName varchar(50),
|
|
|
@sParamType varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bFix bit,
|
|
|
@bVisible bit,
|
|
|
@sDefaultvalue varchar(255),
|
|
|
@bEditable bit,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Auswertungsparameter]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Operator] = @sOperator,
|
|
|
[Feldbezug] = @sFeldbezug,
|
|
|
[Wert] = @sWert,
|
|
|
[ParamName] = @sParamName,
|
|
|
[ParamType] = @sParamType,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Fix] = @bFix,
|
|
|
[Visible] = @bVisible,
|
|
|
[Defaultvalue] = @sDefaultvalue,
|
|
|
[Editable] = @bEditable
|
|
|
WHERE
|
|
|
[Auswertungparameternr] = @iAuswertungparameternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokument_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Dokument'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iDokumentNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokument_Delete]
|
|
|
@iDokumentNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Dokument]
|
|
|
WHERE
|
|
|
[DokumentNr] = @iDokumentNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokument_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Dokument'
|
|
|
-- Gets: @iDokumentNr int
|
|
|
-- Gets: @iKeyValue int
|
|
|
-- Gets: @iDokType int
|
|
|
-- Gets: @iDokumenttypNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @sBeschreibung varchar(2048)
|
|
|
-- Gets: @sFilename varchar(255)
|
|
|
-- Gets: @sOriginalFilename_incl_Path varchar(255)
|
|
|
-- Gets: @sVersion varchar(50)
|
|
|
-- Gets: @sVersionsNr varchar(50)
|
|
|
-- Gets: @daVersionsdatum datetime
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @blobDocImage image
|
|
|
-- Gets: @iSpeichertypNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokument_Insert]
|
|
|
@iDokumentNr int,
|
|
|
@iKeyValue int,
|
|
|
@iDokType int,
|
|
|
@iDokumenttypNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@sBeschreibung varchar(2048),
|
|
|
@sFilename varchar(255),
|
|
|
@sOriginalFilename_incl_Path varchar(255),
|
|
|
@sVersion varchar(50),
|
|
|
@sVersionsNr varchar(50),
|
|
|
@daVersionsdatum datetime,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@blobDocImage image,
|
|
|
@iSpeichertypNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Dokument]
|
|
|
(
|
|
|
[DokumentNr],
|
|
|
[KeyValue],
|
|
|
[DokType],
|
|
|
[DokumenttypNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Filename],
|
|
|
[OriginalFilename_incl_Path],
|
|
|
[Version],
|
|
|
[VersionsNr],
|
|
|
[Versionsdatum],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[DocImage],
|
|
|
[SpeichertypNr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iDokumentNr,
|
|
|
@iKeyValue,
|
|
|
@iDokType,
|
|
|
@iDokumenttypNr,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@sFilename,
|
|
|
@sOriginalFilename_incl_Path,
|
|
|
@sVersion,
|
|
|
@sVersionsNr,
|
|
|
@daVersionsdatum,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@bAktiv,
|
|
|
@blobDocImage,
|
|
|
@iSpeichertypNr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokument_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Dokument'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokument_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[DokumentNr],
|
|
|
[KeyValue],
|
|
|
[DokType],
|
|
|
[DokumenttypNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Filename],
|
|
|
[OriginalFilename_incl_Path],
|
|
|
[Version],
|
|
|
[VersionsNr],
|
|
|
[Versionsdatum],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[DocImage],
|
|
|
[SpeichertypNr]
|
|
|
FROM [dbo].[Dokument]
|
|
|
ORDER BY
|
|
|
[DokumentNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_dokument_selectall_bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[pr_dokument_selectall_bottomtable]
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Kuendigungsfrist'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int,
|
|
|
@mitarbeiternr int
|
|
|
AS
|
|
|
SELECT 0 as DokIcon, dbo.Dokument.DokumentNr, dbo.Dokument.keyvalue as VertragselementNr, dbo.Dokumenttyp.Bezeichnung as Dokumenttyp, dbo.Dokument.Bezeichnung AS Bezeichnung, dbo.Dokument.Beschreibung,
|
|
|
dbo.Dokument.Filename, dbo.Dokument.OriginalFilename_incl_Path, dbo.Dokument.Version, dbo.Dokument.VersionsNr, dbo.Dokument.Versionsdatum,
|
|
|
dbo.Dokument.Erstellt_am, dbo.Dokument.Mutiert_am, dbo.Dokument.Mutierer, dbo.Dokument.Aktiv, dbo.Dokument.SecurityLevelNr
|
|
|
FROM dbo.Dokument INNER JOIN
|
|
|
dbo.Dokumenttyp ON dbo.Dokument.DokumenttypNr = dbo.Dokumenttyp.Dokumenttypnr
|
|
|
where dbo.dokument.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr) and keyvalue = @keyvalue and doktype=1
|
|
|
order by dbo.dokument.erstellt_am desc
|
|
|
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
RETURN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokument_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Dokument'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iDokumentNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokument_SelectOne]
|
|
|
@iDokumentNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[DokumentNr],
|
|
|
[KeyValue],
|
|
|
[DokType],
|
|
|
[DokumenttypNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Filename],
|
|
|
[OriginalFilename_incl_Path],
|
|
|
[Version],
|
|
|
[VersionsNr],
|
|
|
[Versionsdatum],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[DocImage],
|
|
|
[SpeichertypNr]
|
|
|
FROM [dbo].[Dokument]
|
|
|
WHERE
|
|
|
[DokumentNr] = @iDokumentNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokument_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Dokument'
|
|
|
-- Gets: @iDokumentNr int
|
|
|
-- Gets: @iKeyValue int
|
|
|
-- Gets: @iDokType int
|
|
|
-- Gets: @iDokumenttypNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @sBeschreibung varchar(2048)
|
|
|
-- Gets: @sFilename varchar(255)
|
|
|
-- Gets: @sOriginalFilename_incl_Path varchar(255)
|
|
|
-- Gets: @sVersion varchar(50)
|
|
|
-- Gets: @sVersionsNr varchar(50)
|
|
|
-- Gets: @daVersionsdatum datetime
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @blobDocImage image
|
|
|
-- Gets: @iSpeichertypNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokument_Update]
|
|
|
@iDokumentNr int,
|
|
|
@iKeyValue int,
|
|
|
@iDokType int,
|
|
|
@iDokumenttypNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@sBeschreibung varchar(2048),
|
|
|
@sFilename varchar(255),
|
|
|
@sOriginalFilename_incl_Path varchar(255),
|
|
|
@sVersion varchar(50),
|
|
|
@sVersionsNr varchar(50),
|
|
|
@daVersionsdatum datetime,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@blobDocImage image,
|
|
|
@iSpeichertypNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Dokument]
|
|
|
SET
|
|
|
[KeyValue] = @iKeyValue,
|
|
|
[DokType] = @iDokType,
|
|
|
[DokumenttypNr] = @iDokumenttypNr,
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Filename] = @sFilename,
|
|
|
[OriginalFilename_incl_Path] = @sOriginalFilename_incl_Path,
|
|
|
[Version] = @sVersion,
|
|
|
[VersionsNr] = @sVersionsNr,
|
|
|
[Versionsdatum] = @daVersionsdatum,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[DocImage] = @blobDocImage,
|
|
|
[SpeichertypNr] = @iSpeichertypNr
|
|
|
WHERE
|
|
|
[DokumentNr] = @iDokumentNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageort_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'DokumentAblageort'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iDokumentablageortNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageort_Delete]
|
|
|
@iDokumentablageortNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[DokumentAblageort]
|
|
|
WHERE
|
|
|
[DokumentablageortNr] = @iDokumentablageortNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageort_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'DokumentAblageort'
|
|
|
-- Gets: @iDokumentablageortNr int
|
|
|
-- Gets: @iDokumentablagetypNr int
|
|
|
-- Gets: @iDokumentNr int
|
|
|
-- Gets: @sAblageort varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @iMandantNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageort_Insert]
|
|
|
@iDokumentablageortNr int,
|
|
|
@iDokumentablagetypNr int,
|
|
|
@iDokumentNr int,
|
|
|
@sAblageort varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@iMandantNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[DokumentAblageort]
|
|
|
(
|
|
|
[DokumentablageortNr],
|
|
|
[DokumentablagetypNr],
|
|
|
[DokumentNr],
|
|
|
[Ablageort],
|
|
|
[Beschreibung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iDokumentablageortNr,
|
|
|
@iDokumentablagetypNr,
|
|
|
@iDokumentNr,
|
|
|
@sAblageort,
|
|
|
@sBeschreibung,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@bAktiv,
|
|
|
@iMandantNr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageort_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'DokumentAblageort'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageort_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[DokumentablageortNr],
|
|
|
[DokumentablagetypNr],
|
|
|
[DokumentNr],
|
|
|
[Ablageort],
|
|
|
[Beschreibung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[DokumentAblageort]
|
|
|
ORDER BY
|
|
|
[DokumentablageortNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageort_SelectAll_bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'DokumentAblageort'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageort_SelectAll_bottomtable]
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Kuendigungsfrist'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int,
|
|
|
@mitarbeiternr int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[DokumentablageortNr],
|
|
|
[DokumentablagetypNr],
|
|
|
[DokumentNr],
|
|
|
[Ablageort],
|
|
|
[Beschreibung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[DokumentAblageort]
|
|
|
Where dokumentnr=@keyvalue
|
|
|
ORDER BY
|
|
|
[DokumentablageortNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageort_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'DokumentAblageort'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iDokumentablageortNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageort_SelectOne]
|
|
|
@iDokumentablageortNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[DokumentablageortNr],
|
|
|
[DokumentablagetypNr],
|
|
|
[DokumentNr],
|
|
|
[Ablageort],
|
|
|
[Beschreibung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[DokumentAblageort]
|
|
|
WHERE
|
|
|
[DokumentablageortNr] = @iDokumentablageortNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageort_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'DokumentAblageort'
|
|
|
-- Gets: @iDokumentablageortNr int
|
|
|
-- Gets: @iDokumentablagetypNr int
|
|
|
-- Gets: @iDokumentNr int
|
|
|
-- Gets: @sAblageort varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @iMandantNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageort_Update]
|
|
|
@iDokumentablageortNr int,
|
|
|
@iDokumentablagetypNr int,
|
|
|
@iDokumentNr int,
|
|
|
@sAblageort varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@iMandantNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[DokumentAblageort]
|
|
|
SET
|
|
|
[DokumentablagetypNr] = @iDokumentablagetypNr,
|
|
|
[DokumentNr] = @iDokumentNr,
|
|
|
[Ablageort] = @sAblageort,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[MandantNr] = @iMandantNr
|
|
|
WHERE
|
|
|
[DokumentablageortNr] = @iDokumentablageortNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageTyp_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'DokumentAblageTyp'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iDokumentAblageTypNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageTyp_Delete]
|
|
|
@iDokumentAblageTypNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[DokumentAblageTyp]
|
|
|
WHERE
|
|
|
[DokumentAblageTypNr] = @iDokumentAblageTypNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageTyp_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'DokumentAblageTyp'
|
|
|
-- Gets: @iDokumentAblageTypNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @iMandantNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageTyp_Insert]
|
|
|
@iDokumentAblageTypNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@iMandantNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[DokumentAblageTyp]
|
|
|
(
|
|
|
[DokumentAblageTypNr],
|
|
|
[Bezeichnung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iDokumentAblageTypNr,
|
|
|
@sBezeichnung,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@bAktiv,
|
|
|
@iMandantNr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageTyp_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'DokumentAblageTyp'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageTyp_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[DokumentAblageTypNr],
|
|
|
[Bezeichnung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[DokumentAblageTyp]
|
|
|
ORDER BY
|
|
|
[DokumentAblageTypNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageTyp_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'DokumentAblageTyp'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iDokumentAblageTypNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageTyp_SelectOne]
|
|
|
@iDokumentAblageTypNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[DokumentAblageTypNr],
|
|
|
[Bezeichnung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[DokumentAblageTyp]
|
|
|
WHERE
|
|
|
[DokumentAblageTypNr] = @iDokumentAblageTypNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_DokumentAblageTyp_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'DokumentAblageTyp'
|
|
|
-- Gets: @iDokumentAblageTypNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @iMandantNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_DokumentAblageTyp_Update]
|
|
|
@iDokumentAblageTypNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@iMandantNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[DokumentAblageTyp]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[MandantNr] = @iMandantNr
|
|
|
WHERE
|
|
|
[DokumentAblageTypNr] = @iDokumentAblageTypNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokumenttyp_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Dokumenttyp'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iDokumenttypnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokumenttyp_Delete]
|
|
|
@iDokumenttypnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Dokumenttyp]
|
|
|
WHERE
|
|
|
[Dokumenttypnr] = @iDokumenttypnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokumenttyp_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Dokumenttyp'
|
|
|
-- Gets: @iDokumenttypnr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokumenttyp_Insert]
|
|
|
@iDokumenttypnr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Dokumenttyp]
|
|
|
(
|
|
|
[Dokumenttypnr],
|
|
|
[Bezeichnung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iDokumenttypnr,
|
|
|
@sBezeichnung,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@bAktiv
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokumenttyp_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Dokumenttyp'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokumenttyp_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[Dokumenttypnr],
|
|
|
[Bezeichnung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv]
|
|
|
FROM [dbo].[Dokumenttyp]
|
|
|
ORDER BY
|
|
|
[Dokumenttypnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokumenttyp_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Dokumenttyp'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iDokumenttypnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokumenttyp_SelectOne]
|
|
|
@iDokumenttypnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[Dokumenttypnr],
|
|
|
[Bezeichnung],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Aktiv]
|
|
|
FROM [dbo].[Dokumenttyp]
|
|
|
WHERE
|
|
|
[Dokumenttypnr] = @iDokumenttypnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Dokumenttyp_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Dokumenttyp'
|
|
|
-- Gets: @iDokumenttypnr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Dokumenttyp_Update]
|
|
|
@iDokumenttypnr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@bAktiv bit,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Dokumenttyp]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Aktiv] = @bAktiv
|
|
|
WHERE
|
|
|
[Dokumenttypnr] = @iDokumenttypnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktion_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Funktion'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iFunktionNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktion_Delete]
|
|
|
@iFunktionNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Funktion]
|
|
|
WHERE
|
|
|
[FunktionNr] = @iFunktionNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktion_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Funktion'
|
|
|
-- Gets: @iFunktionNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktion_Insert]
|
|
|
@iFunktionNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Funktion]
|
|
|
(
|
|
|
[FunktionNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iFunktionNr,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktion_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Funktion'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktion_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[FunktionNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[Funktion]
|
|
|
ORDER BY
|
|
|
[FunktionNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktion_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Funktion'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iFunktionNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktion_SelectOne]
|
|
|
@iFunktionNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[FunktionNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[Funktion]
|
|
|
WHERE
|
|
|
[FunktionNr] = @iFunktionNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktion_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Funktion'
|
|
|
-- Gets: @iFunktionNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktion_Update]
|
|
|
@iFunktionNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Funktion]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[FunktionNr] = @iFunktionNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktionsgruppe_auswertungGruppe_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Funktionsgruppe_auswertungGruppe'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iFunktionsgruppe_AuswertungGruppenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktionsgruppe_auswertungGruppe_Delete]
|
|
|
@iFunktionsgruppe_AuswertungGruppenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Funktionsgruppe_auswertungGruppe]
|
|
|
WHERE
|
|
|
[Funktionsgruppe_AuswertungGruppenr] = @iFunktionsgruppe_AuswertungGruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktionsgruppe_auswertungGruppe_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Funktionsgruppe_auswertungGruppe'
|
|
|
-- Gets: @iFunktionsgruppe_AuswertungGruppenr int
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktionsgruppe_auswertungGruppe_Insert]
|
|
|
@iFunktionsgruppe_AuswertungGruppenr int,
|
|
|
@ifunktionsgruppenr int,
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Funktionsgruppe_auswertungGruppe]
|
|
|
(
|
|
|
[Funktionsgruppe_AuswertungGruppenr],
|
|
|
[funktionsgruppenr],
|
|
|
[AuswertungGruppeNr],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iFunktionsgruppe_AuswertungGruppenr,
|
|
|
@ifunktionsgruppenr,
|
|
|
@iAuswertungGruppeNr,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktionsgruppe_auswertungGruppe_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Funktionsgruppe_auswertungGruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktionsgruppe_auswertungGruppe_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[Funktionsgruppe_AuswertungGruppenr],
|
|
|
[funktionsgruppenr],
|
|
|
[AuswertungGruppeNr],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[Funktionsgruppe_auswertungGruppe]
|
|
|
ORDER BY
|
|
|
[Funktionsgruppe_AuswertungGruppenr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktionsgruppe_AuswertungGruppe_SelectAll_Bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
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_AuswertungGruppe_SelectAll_Bottomtable]
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
|
|
|
if @fokus = 1 begin
|
|
|
SELECT dbo.funktionsgruppe_auswertungGruppe.Funktionsgruppe_AuswertungGruppenr, dbo.funktionsgruppe_auswertungGruppe.funktionsgruppenr,
|
|
|
dbo.funktionsgruppe.bezeichnung AS Funktion, dbo.funktionsgruppe_auswertungGruppe.AuswertungGruppeNr,
|
|
|
dbo.AuswertungGruppe.Bezeichnung AS AuswertungGruppe, dbo.funktionsgruppe_auswertungGruppe.Aktiv, dbo.funktionsgruppe_auswertungGruppe.Erstellt_am,
|
|
|
dbo.funktionsgruppe_auswertungGruppe.Mutiert_am, dbo.funktionsgruppe_auswertungGruppe.Mutierer
|
|
|
FROM dbo.funktionsgruppe_auswertungGruppe INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.funktionsgruppe_auswertungGruppe.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
|
dbo.AuswertungGruppe ON dbo.funktionsgruppe_auswertungGruppe.AuswertungGruppeNr = dbo.AuswertungGruppe.AuswertungGruppeNr
|
|
|
where Funktionsgruppe_AuswertungGruppe.funktionsgruppenr=@keyvalue
|
|
|
ORDER BY dbo.funktionsgruppe_auswertungGruppe.Funktionsgruppe_AuswertungGruppeNr
|
|
|
end else begin
|
|
|
SELECT dbo.funktionsgruppe_auswertungGruppe.Funktionsgruppe_AuswertungGruppenr, dbo.funktionsgruppe_auswertungGruppe.funktionsgruppenr,
|
|
|
dbo.funktionsgruppe.bezeichnung AS Funktion, dbo.funktionsgruppe_auswertungGruppe.AuswertungGruppeNr,
|
|
|
dbo.AuswertungGruppe.Bezeichnung AS AuswertungGruppe, dbo.funktionsgruppe_auswertungGruppe.Aktiv, dbo.funktionsgruppe_auswertungGruppe.Erstellt_am,
|
|
|
dbo.funktionsgruppe_auswertungGruppe.Mutiert_am, dbo.funktionsgruppe_auswertungGruppe.Mutierer
|
|
|
FROM dbo.funktionsgruppe_auswertungGruppe INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.funktionsgruppe_auswertungGruppe.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
|
dbo.AuswertungGruppe ON dbo.funktionsgruppe_auswertungGruppe.AuswertungGruppeNr = dbo.AuswertungGruppe.AuswertungGruppeNr
|
|
|
where Funktionsgruppe_AuswertungGruppe.AuswertungGruppeNr=@keyvalue
|
|
|
ORDER BY dbo.funktionsgruppe_auswertungGruppe.Funktionsgruppe_AuswertungGruppeNr
|
|
|
|
|
|
|
|
|
end
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktionsgruppe_auswertungGruppe_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Funktionsgruppe_auswertungGruppe'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iFunktionsgruppe_AuswertungGruppenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktionsgruppe_auswertungGruppe_SelectOne]
|
|
|
@iFunktionsgruppe_AuswertungGruppenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[Funktionsgruppe_AuswertungGruppenr],
|
|
|
[funktionsgruppenr],
|
|
|
[AuswertungGruppeNr],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[Funktionsgruppe_auswertungGruppe]
|
|
|
WHERE
|
|
|
[Funktionsgruppe_AuswertungGruppenr] = @iFunktionsgruppe_AuswertungGruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Funktionsgruppe_auswertungGruppe_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Funktionsgruppe_auswertungGruppe'
|
|
|
-- Gets: @iFunktionsgruppe_AuswertungGruppenr int
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @iAuswertungGruppeNr int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Funktionsgruppe_auswertungGruppe_Update]
|
|
|
@iFunktionsgruppe_AuswertungGruppenr int,
|
|
|
@ifunktionsgruppenr int,
|
|
|
@iAuswertungGruppeNr int,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Funktionsgruppe_auswertungGruppe]
|
|
|
SET
|
|
|
[funktionsgruppenr] = @ifunktionsgruppenr,
|
|
|
[AuswertungGruppeNr] = @iAuswertungGruppeNr,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[Funktionsgruppe_AuswertungGruppenr] = @iFunktionsgruppe_AuswertungGruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'funktionsgruppe'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_Delete]
|
|
|
@ifunktionsgruppenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[funktionsgruppe]
|
|
|
WHERE
|
|
|
[funktionsgruppenr] = @ifunktionsgruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'funktionsgruppe'
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @sbezeichnung varchar(50)
|
|
|
-- Gets: @sbeschreibung varchar(50)
|
|
|
-- Gets: @szugehoerigkeit varchar(255)
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_Insert]
|
|
|
@ifunktionsgruppenr int,
|
|
|
@sbezeichnung varchar(50),
|
|
|
@sbeschreibung varchar(50),
|
|
|
@szugehoerigkeit varchar(255),
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[funktionsgruppe]
|
|
|
(
|
|
|
[funktionsgruppenr],
|
|
|
[bezeichnung],
|
|
|
[beschreibung],
|
|
|
[zugehoerigkeit],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@ifunktionsgruppenr,
|
|
|
@sbezeichnung,
|
|
|
@sbeschreibung,
|
|
|
@szugehoerigkeit,
|
|
|
@imandantnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'funktionsgruppe_rolle'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iFunktionsgrupperollenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_rolle_Delete]
|
|
|
@iFunktionsgrupperollenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[funktionsgruppe_rolle]
|
|
|
WHERE
|
|
|
[Funktionsgrupperollenr] = @iFunktionsgrupperollenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'funktionsgruppe_rolle'
|
|
|
-- Gets: @iFunktionsgrupperollenr int
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_rolle_Insert]
|
|
|
@iFunktionsgrupperollenr int,
|
|
|
@ifunktionsgruppenr int,
|
|
|
@irollenr int,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[funktionsgruppe_rolle]
|
|
|
(
|
|
|
[Funktionsgrupperollenr],
|
|
|
[funktionsgruppenr],
|
|
|
[rollenr],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iFunktionsgrupperollenr,
|
|
|
@ifunktionsgruppenr,
|
|
|
@irollenr,
|
|
|
@imandantnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'funktionsgruppe_rolle'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_rolle_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[Funktionsgrupperollenr],
|
|
|
[funktionsgruppenr],
|
|
|
[rollenr],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[funktionsgruppe_rolle]
|
|
|
ORDER BY
|
|
|
[Funktionsgrupperollenr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_SelectAll_Bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
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
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'funktionsgruppe_rolle'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iFunktionsgrupperollenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_rolle_SelectOne]
|
|
|
@iFunktionsgrupperollenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[Funktionsgrupperollenr],
|
|
|
[funktionsgruppenr],
|
|
|
[rollenr],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[funktionsgruppe_rolle]
|
|
|
WHERE
|
|
|
[Funktionsgrupperollenr] = @iFunktionsgrupperollenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_rolle_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'funktionsgruppe_rolle'
|
|
|
-- Gets: @iFunktionsgrupperollenr int
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_rolle_Update]
|
|
|
@iFunktionsgrupperollenr int,
|
|
|
@ifunktionsgruppenr int,
|
|
|
@irollenr int,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[funktionsgruppe_rolle]
|
|
|
SET
|
|
|
[funktionsgruppenr] = @ifunktionsgruppenr,
|
|
|
[rollenr] = @irollenr,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[Funktionsgrupperollenr] = @iFunktionsgrupperollenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'funktionsgruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[funktionsgruppenr],
|
|
|
[bezeichnung],
|
|
|
[beschreibung],
|
|
|
[zugehoerigkeit],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[funktionsgruppe]
|
|
|
ORDER BY
|
|
|
[funktionsgruppenr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'funktionsgruppe'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_SelectOne]
|
|
|
@ifunktionsgruppenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[funktionsgruppenr],
|
|
|
[bezeichnung],
|
|
|
[beschreibung],
|
|
|
[zugehoerigkeit],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[funktionsgruppe]
|
|
|
WHERE
|
|
|
[funktionsgruppenr] = @ifunktionsgruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_funktionsgruppe_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'funktionsgruppe'
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @sbezeichnung varchar(50)
|
|
|
-- Gets: @sbeschreibung varchar(50)
|
|
|
-- Gets: @szugehoerigkeit varchar(255)
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_funktionsgruppe_Update]
|
|
|
@ifunktionsgruppenr int,
|
|
|
@sbezeichnung varchar(50),
|
|
|
@sbeschreibung varchar(50),
|
|
|
@szugehoerigkeit varchar(255),
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[funktionsgruppe]
|
|
|
SET
|
|
|
[bezeichnung] = @sbezeichnung,
|
|
|
[beschreibung] = @sbeschreibung,
|
|
|
[zugehoerigkeit] = @szugehoerigkeit,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[funktionsgruppenr] = @ifunktionsgruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kategorie_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Kategorie'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iKategorieNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kategorie_Delete]
|
|
|
@iKategorieNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Kategorie]
|
|
|
WHERE
|
|
|
[KategorieNr] = @iKategorieNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kategorie_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Kategorie'
|
|
|
-- Gets: @iKategorieNr int
|
|
|
-- Gets: @iParentid int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kategorie_Insert]
|
|
|
@iKategorieNr int,
|
|
|
@iParentid int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Kategorie]
|
|
|
(
|
|
|
[KategorieNr],
|
|
|
[Parentid],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iKategorieNr,
|
|
|
@iParentid,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kategorie_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Kategorie'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kategorie_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[KategorieNr],
|
|
|
[Parentid],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Kategorie]
|
|
|
ORDER BY
|
|
|
[KategorieNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kategorie_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Kategorie'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iKategorieNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kategorie_SelectOne]
|
|
|
@iKategorieNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[KategorieNr],
|
|
|
[Parentid],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Kategorie]
|
|
|
WHERE
|
|
|
[KategorieNr] = @iKategorieNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kategorie_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Kategorie'
|
|
|
-- Gets: @iKategorieNr int
|
|
|
-- Gets: @iParentid int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kategorie_Update]
|
|
|
@iKategorieNr int,
|
|
|
@iParentid int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Kategorie]
|
|
|
SET
|
|
|
[Parentid] = @iParentid,
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[KategorieNr] = @iKategorieNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_key_tabelle_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'key_tabelle'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @ikeynr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_key_tabelle_Delete]
|
|
|
@ikeynr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[key_tabelle]
|
|
|
WHERE
|
|
|
[keynr] = @ikeynr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_key_tabelle_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'key_tabelle'
|
|
|
-- Gets: @sbeschreibung varchar(255)
|
|
|
-- Gets: @ikey_wert int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @ikeynr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_key_tabelle_Insert]
|
|
|
@sbeschreibung varchar(255),
|
|
|
@ikey_wert int,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@ikeynr int OUTPUT,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[key_tabelle]
|
|
|
(
|
|
|
[beschreibung],
|
|
|
[key_wert],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@sbeschreibung,
|
|
|
@ikey_wert,
|
|
|
@imandantnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
-- Get the IDENTITY value for the row just inserted.
|
|
|
SELECT @ikeynr=SCOPE_IDENTITY()
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_key_tabelle_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'key_tabelle'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_key_tabelle_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[keynr],
|
|
|
[beschreibung],
|
|
|
[key_wert],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[key_tabelle]
|
|
|
ORDER BY
|
|
|
[keynr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_key_tabelle_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'key_tabelle'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @ikeynr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_key_tabelle_SelectOne]
|
|
|
@ikeynr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[keynr],
|
|
|
[beschreibung],
|
|
|
[key_wert],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[key_tabelle]
|
|
|
WHERE
|
|
|
[keynr] = @ikeynr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_key_tabelle_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'key_tabelle'
|
|
|
-- Gets: @ikeynr int
|
|
|
-- Gets: @sbeschreibung varchar(255)
|
|
|
-- Gets: @ikey_wert int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_key_tabelle_Update]
|
|
|
@ikeynr int,
|
|
|
@sbeschreibung varchar(255),
|
|
|
@ikey_wert int,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[key_tabelle]
|
|
|
SET
|
|
|
[beschreibung] = @sbeschreibung,
|
|
|
[key_wert] = @ikey_wert,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[keynr] = @ikeynr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kommunikation_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Kommunikation'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iKommunikationNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kommunikation_Delete]
|
|
|
@iKommunikationNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Kommunikation]
|
|
|
WHERE
|
|
|
[KommunikationNr] = @iKommunikationNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kommunikation_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Kommunikation'
|
|
|
-- Gets: @iKommunikationNr int
|
|
|
-- Gets: @iThemaNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kommunikation_Insert]
|
|
|
@iKommunikationNr int,
|
|
|
@iThemaNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Kommunikation]
|
|
|
(
|
|
|
[KommunikationNr],
|
|
|
[ThemaNr],
|
|
|
[Bezeichnung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iKommunikationNr,
|
|
|
@iThemaNr,
|
|
|
@sBezeichnung,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kommunikation_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Kommunikation'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kommunikation_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[KommunikationNr],
|
|
|
[ThemaNr],
|
|
|
[Bezeichnung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Kommunikation]
|
|
|
ORDER BY
|
|
|
[KommunikationNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kommunikation_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Kommunikation'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iKommunikationNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kommunikation_SelectOne]
|
|
|
@iKommunikationNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[KommunikationNr],
|
|
|
[ThemaNr],
|
|
|
[Bezeichnung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Kommunikation]
|
|
|
WHERE
|
|
|
[KommunikationNr] = @iKommunikationNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Kommunikation_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Kommunikation'
|
|
|
-- Gets: @iKommunikationNr int
|
|
|
-- Gets: @iThemaNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Kommunikation_Update]
|
|
|
@iKommunikationNr int,
|
|
|
@iThemaNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Kommunikation]
|
|
|
SET
|
|
|
[ThemaNr] = @iThemaNr,
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[KommunikationNr] = @iKommunikationNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunikationAuspraegung_Zielgruppe_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'KommunikationAuspraegung_Zielgruppe'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iKommAuspraegungZielgruppeNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunikationAuspraegung_Zielgruppe_Delete]
|
|
|
@iKommAuspraegungZielgruppeNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[KommunikationAuspraegung_Zielgruppe]
|
|
|
WHERE
|
|
|
[KommAuspraegungZielgruppeNr] = @iKommAuspraegungZielgruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunikationAuspraegung_Zielgruppe_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'KommunikationAuspraegung_Zielgruppe'
|
|
|
-- Gets: @iKommAuspraegungZielgruppeNr int
|
|
|
-- Gets: @iKommunikationauspraegungnr int
|
|
|
-- Gets: @iZielgruppenr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunikationAuspraegung_Zielgruppe_Insert]
|
|
|
@iKommAuspraegungZielgruppeNr int,
|
|
|
@iKommunikationauspraegungnr int,
|
|
|
@iZielgruppenr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[KommunikationAuspraegung_Zielgruppe]
|
|
|
(
|
|
|
[KommAuspraegungZielgruppeNr],
|
|
|
[Kommunikationauspraegungnr],
|
|
|
[Zielgruppenr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iKommAuspraegungZielgruppeNr,
|
|
|
@iKommunikationauspraegungnr,
|
|
|
@iZielgruppenr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunikationAuspraegung_Zielgruppe_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'KommunikationAuspraegung_Zielgruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunikationAuspraegung_Zielgruppe_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[KommAuspraegungZielgruppeNr],
|
|
|
[Kommunikationauspraegungnr],
|
|
|
[Zielgruppenr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[KommunikationAuspraegung_Zielgruppe]
|
|
|
ORDER BY
|
|
|
[KommAuspraegungZielgruppeNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunikationAuspraegung_Zielgruppe_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'KommunikationAuspraegung_Zielgruppe'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iKommAuspraegungZielgruppeNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunikationAuspraegung_Zielgruppe_SelectOne]
|
|
|
@iKommAuspraegungZielgruppeNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[KommAuspraegungZielgruppeNr],
|
|
|
[Kommunikationauspraegungnr],
|
|
|
[Zielgruppenr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[KommunikationAuspraegung_Zielgruppe]
|
|
|
WHERE
|
|
|
[KommAuspraegungZielgruppeNr] = @iKommAuspraegungZielgruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunikationAuspraegung_Zielgruppe_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'KommunikationAuspraegung_Zielgruppe'
|
|
|
-- Gets: @iKommAuspraegungZielgruppeNr int
|
|
|
-- Gets: @iKommunikationauspraegungnr int
|
|
|
-- Gets: @iZielgruppenr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunikationAuspraegung_Zielgruppe_Update]
|
|
|
@iKommAuspraegungZielgruppeNr int,
|
|
|
@iKommunikationauspraegungnr int,
|
|
|
@iZielgruppenr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[KommunikationAuspraegung_Zielgruppe]
|
|
|
SET
|
|
|
[Kommunikationauspraegungnr] = @iKommunikationauspraegungnr,
|
|
|
[Zielgruppenr] = @iZielgruppenr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[KommAuspraegungZielgruppeNr] = @iKommAuspraegungZielgruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunkationAuspraegung_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'KommunkationAuspraegung'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iKommunikationAuspraegungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunkationAuspraegung_Delete]
|
|
|
@iKommunikationAuspraegungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[KommunkationAuspraegung]
|
|
|
WHERE
|
|
|
[KommunikationAuspraegungNr] = @iKommunikationAuspraegungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunkationAuspraegung_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'KommunkationAuspraegung'
|
|
|
-- Gets: @iKommunikationAuspraegungNr int
|
|
|
-- Gets: @iKommunikationNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @blobDokument image
|
|
|
-- Gets: @sRTFText varchar(-1)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunkationAuspraegung_Insert]
|
|
|
@iKommunikationAuspraegungNr int,
|
|
|
@iKommunikationNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@blobDokument image,
|
|
|
@sRTFText varchar(max),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[KommunkationAuspraegung]
|
|
|
(
|
|
|
[KommunikationAuspraegungNr],
|
|
|
[KommunikationNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Dokument],
|
|
|
[RTFText],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iKommunikationAuspraegungNr,
|
|
|
@iKommunikationNr,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@blobDokument,
|
|
|
@sRTFText,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunkationAuspraegung_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'KommunkationAuspraegung'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunkationAuspraegung_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[KommunikationAuspraegungNr],
|
|
|
[KommunikationNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Dokument],
|
|
|
[RTFText],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[KommunkationAuspraegung]
|
|
|
ORDER BY
|
|
|
[KommunikationAuspraegungNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunkationAuspraegung_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'KommunkationAuspraegung'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iKommunikationAuspraegungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunkationAuspraegung_SelectOne]
|
|
|
@iKommunikationAuspraegungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[KommunikationAuspraegungNr],
|
|
|
[KommunikationNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Dokument],
|
|
|
[RTFText],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[KommunkationAuspraegung]
|
|
|
WHERE
|
|
|
[KommunikationAuspraegungNr] = @iKommunikationAuspraegungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_KommunkationAuspraegung_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'KommunkationAuspraegung'
|
|
|
-- Gets: @iKommunikationAuspraegungNr int
|
|
|
-- Gets: @iKommunikationNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @blobDokument image
|
|
|
-- Gets: @sRTFText varchar(-1)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_KommunkationAuspraegung_Update]
|
|
|
@iKommunikationAuspraegungNr int,
|
|
|
@iKommunikationNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@blobDokument image,
|
|
|
@sRTFText varchar(max),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[KommunkationAuspraegung]
|
|
|
SET
|
|
|
[KommunikationNr] = @iKommunikationNr,
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Dokument] = @blobDokument,
|
|
|
[RTFText] = @sRTFText,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[KommunikationAuspraegungNr] = @iKommunikationAuspraegungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'meldungstexte'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @imeldungstextnr int
|
|
|
-- Gets: @isprache int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_Delete]
|
|
|
@imeldungstextnr int,
|
|
|
@isprache int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[meldungstexte]
|
|
|
WHERE
|
|
|
[meldungstextnr] = @imeldungstextnr
|
|
|
AND [sprache] = @isprache
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_DeleteAllWmeldungstextnrLogic] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete one or more existing rows from the table 'meldungstexte'
|
|
|
-- using the Primary Key field [meldungstextnr].
|
|
|
-- Gets: @imeldungstextnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_DeleteAllWmeldungstextnrLogic]
|
|
|
@imeldungstextnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE one or more existing rows from the table.
|
|
|
DELETE FROM [dbo].[meldungstexte]
|
|
|
WHERE
|
|
|
[meldungstextnr] = @imeldungstextnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_DeleteAllWspracheLogic] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete one or more existing rows from the table 'meldungstexte'
|
|
|
-- using the Primary Key field [sprache].
|
|
|
-- Gets: @isprache int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_DeleteAllWspracheLogic]
|
|
|
@isprache int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE one or more existing rows from the table.
|
|
|
DELETE FROM [dbo].[meldungstexte]
|
|
|
WHERE
|
|
|
[sprache] = @isprache
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'meldungstexte'
|
|
|
-- Gets: @imeldungstextnr int
|
|
|
-- Gets: @isprache int
|
|
|
-- Gets: @sinhalt varchar(1024)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_Insert]
|
|
|
@imeldungstextnr int,
|
|
|
@isprache int,
|
|
|
@sinhalt varchar(1024),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@imandantnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[meldungstexte]
|
|
|
(
|
|
|
[meldungstextnr],
|
|
|
[sprache],
|
|
|
[inhalt],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@imeldungstextnr,
|
|
|
@isprache,
|
|
|
@sinhalt,
|
|
|
@sBeschreibung,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer,
|
|
|
@imandantnr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'meldungstexte'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[meldungstextnr],
|
|
|
[sprache],
|
|
|
[inhalt],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr]
|
|
|
FROM [dbo].[meldungstexte]
|
|
|
ORDER BY
|
|
|
[meldungstextnr] ASC
|
|
|
, [sprache] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'meldungstexte'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @imeldungstextnr int
|
|
|
-- Gets: @isprache int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_SelectOne]
|
|
|
@imeldungstextnr int,
|
|
|
@isprache int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[meldungstextnr],
|
|
|
[sprache],
|
|
|
[inhalt],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr]
|
|
|
FROM [dbo].[meldungstexte]
|
|
|
WHERE
|
|
|
[meldungstextnr] = @imeldungstextnr
|
|
|
AND [sprache] = @isprache
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_meldungstexte_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'meldungstexte'
|
|
|
-- Gets: @imeldungstextnr int
|
|
|
-- Gets: @isprache int
|
|
|
-- Gets: @sinhalt varchar(1024)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_meldungstexte_Update]
|
|
|
@imeldungstextnr int,
|
|
|
@isprache int,
|
|
|
@sinhalt varchar(1024),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@imandantnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[meldungstexte]
|
|
|
SET
|
|
|
[inhalt] = @sinhalt,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer,
|
|
|
[mandantnr] = @imandantnr
|
|
|
WHERE
|
|
|
[meldungstextnr] = @imeldungstextnr
|
|
|
AND [sprache] = @isprache
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'mitarbeiter'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @imitarbeiternr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_Delete]
|
|
|
@imitarbeiternr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[mitarbeiter]
|
|
|
WHERE
|
|
|
[mitarbeiternr] = @imitarbeiternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_funktionsgruppe_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'mitarbeiter_funktionsgruppe'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @imitarbeiter_funktionsgruppenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_funktionsgruppe_Delete]
|
|
|
@imitarbeiter_funktionsgruppenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[mitarbeiter_funktionsgruppe]
|
|
|
WHERE
|
|
|
[mitarbeiter_funktionsgruppenr] = @imitarbeiter_funktionsgruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_funktionsgruppe_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'mitarbeiter_funktionsgruppe'
|
|
|
-- Gets: @imitarbeiter_funktionsgruppenr int
|
|
|
-- Gets: @imitarbeiternr int
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_funktionsgruppe_Insert]
|
|
|
@imitarbeiter_funktionsgruppenr int,
|
|
|
@imitarbeiternr int,
|
|
|
@ifunktionsgruppenr int,
|
|
|
@baktiv bit,
|
|
|
@imandantnr int,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[mitarbeiter_funktionsgruppe]
|
|
|
(
|
|
|
[mitarbeiter_funktionsgruppenr],
|
|
|
[mitarbeiternr],
|
|
|
[funktionsgruppenr],
|
|
|
[aktiv],
|
|
|
[mandantnr],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@imitarbeiter_funktionsgruppenr,
|
|
|
@imitarbeiternr,
|
|
|
@ifunktionsgruppenr,
|
|
|
@baktiv,
|
|
|
@imandantnr,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_funktionsgruppe_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'mitarbeiter_funktionsgruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_funktionsgruppe_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[mitarbeiter_funktionsgruppenr],
|
|
|
[mitarbeiternr],
|
|
|
[funktionsgruppenr],
|
|
|
[aktiv],
|
|
|
[mandantnr],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[mitarbeiter_funktionsgruppe]
|
|
|
ORDER BY
|
|
|
[mitarbeiter_funktionsgruppenr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_funktionsgruppe_SelectAll_Bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'mitarbeiter_funktionsgruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_funktionsgruppe_SelectAll_Bottomtable]
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
|
|
|
if @fokus = 1 begin
|
|
|
SELECT TOP 100 PERCENT dbo.mitarbeiter_funktionsgruppe.mitarbeiter_funktionsgruppenr, dbo.mitarbeiter_funktionsgruppe.mitarbeiternr,
|
|
|
dbo.mitarbeiter.name + ' ' + dbo.mitarbeiter.vorname AS Mitarbeiter, dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr,
|
|
|
dbo.funktionsgruppe.bezeichnung, dbo.mitarbeiter_funktionsgruppe.aktiv, dbo.mitarbeiter_funktionsgruppe.mandantnr,
|
|
|
dbo.mitarbeiter_funktionsgruppe.erstellt_am, dbo.mitarbeiter_funktionsgruppe.mutiert_am, dbo.mitarbeiter_funktionsgruppe.mutierer
|
|
|
FROM dbo.mitarbeiter_funktionsgruppe INNER JOIN
|
|
|
dbo.mitarbeiter ON dbo.mitarbeiter_funktionsgruppe.mitarbeiternr = dbo.mitarbeiter.mitarbeiternr INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr
|
|
|
where dbo.mitarbeiter_funktionsgruppe.mitarbeiternr = @keyvalue
|
|
|
ORDER BY dbo.mitarbeiter_funktionsgruppe.mitarbeiter_funktionsgruppenr
|
|
|
end else begin
|
|
|
SELECT TOP 100 PERCENT dbo.mitarbeiter_funktionsgruppe.mitarbeiter_funktionsgruppenr, dbo.mitarbeiter_funktionsgruppe.mitarbeiternr,
|
|
|
dbo.mitarbeiter.name + ' ' + dbo.mitarbeiter.vorname AS Mitarbeiter, dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr,
|
|
|
dbo.funktionsgruppe.bezeichnung, dbo.mitarbeiter_funktionsgruppe.aktiv, dbo.mitarbeiter_funktionsgruppe.mandantnr,
|
|
|
dbo.mitarbeiter_funktionsgruppe.erstellt_am, dbo.mitarbeiter_funktionsgruppe.mutiert_am, dbo.mitarbeiter_funktionsgruppe.mutierer
|
|
|
FROM dbo.mitarbeiter_funktionsgruppe INNER JOIN
|
|
|
dbo.mitarbeiter ON dbo.mitarbeiter_funktionsgruppe.mitarbeiternr = dbo.mitarbeiter.mitarbeiternr INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr
|
|
|
where dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr = @keyvalue
|
|
|
ORDER BY dbo.mitarbeiter_funktionsgruppe.mitarbeiter_funktionsgruppenr
|
|
|
end
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_funktionsgruppe_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'mitarbeiter_funktionsgruppe'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @imitarbeiter_funktionsgruppenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_funktionsgruppe_SelectOne]
|
|
|
@imitarbeiter_funktionsgruppenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[mitarbeiter_funktionsgruppenr],
|
|
|
[mitarbeiternr],
|
|
|
[funktionsgruppenr],
|
|
|
[aktiv],
|
|
|
[mandantnr],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[mitarbeiter_funktionsgruppe]
|
|
|
WHERE
|
|
|
[mitarbeiter_funktionsgruppenr] = @imitarbeiter_funktionsgruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_funktionsgruppe_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'mitarbeiter_funktionsgruppe'
|
|
|
-- Gets: @imitarbeiter_funktionsgruppenr int
|
|
|
-- Gets: @imitarbeiternr int
|
|
|
-- Gets: @ifunktionsgruppenr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_funktionsgruppe_Update]
|
|
|
@imitarbeiter_funktionsgruppenr int,
|
|
|
@imitarbeiternr int,
|
|
|
@ifunktionsgruppenr int,
|
|
|
@baktiv bit,
|
|
|
@imandantnr int,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[mitarbeiter_funktionsgruppe]
|
|
|
SET
|
|
|
[mitarbeiternr] = @imitarbeiternr,
|
|
|
[funktionsgruppenr] = @ifunktionsgruppenr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[mitarbeiter_funktionsgruppenr] = @imitarbeiter_funktionsgruppenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'mitarbeiter'
|
|
|
-- Gets: @imitarbeiternr int
|
|
|
-- Gets: @svorname varchar(50)
|
|
|
-- Gets: @sname varchar(50)
|
|
|
-- Gets: @stgnummer varchar(50)
|
|
|
-- Gets: @semail varchar(50)
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_Insert]
|
|
|
@imitarbeiternr int,
|
|
|
@svorname varchar(50),
|
|
|
@sname varchar(50),
|
|
|
@stgnummer varchar(50),
|
|
|
@semail varchar(50),
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[mitarbeiter]
|
|
|
(
|
|
|
[mitarbeiternr],
|
|
|
[vorname],
|
|
|
[name],
|
|
|
[tgnummer],
|
|
|
[email],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@imitarbeiternr,
|
|
|
@svorname,
|
|
|
@sname,
|
|
|
@stgnummer,
|
|
|
@semail,
|
|
|
@imandantnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'mitarbeiter'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[mitarbeiternr],
|
|
|
[vorname],
|
|
|
[name],
|
|
|
[tgnummer],
|
|
|
[email],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[mitarbeiter]
|
|
|
ORDER BY
|
|
|
[mitarbeiternr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'mitarbeiter'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @imitarbeiternr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_SelectOne]
|
|
|
@imitarbeiternr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[mitarbeiternr],
|
|
|
[vorname],
|
|
|
[name],
|
|
|
[tgnummer],
|
|
|
[email],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[mitarbeiter]
|
|
|
WHERE
|
|
|
[mitarbeiternr] = @imitarbeiternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_mitarbeiter_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'mitarbeiter'
|
|
|
-- Gets: @imitarbeiternr int
|
|
|
-- Gets: @svorname varchar(50)
|
|
|
-- Gets: @sname varchar(50)
|
|
|
-- Gets: @stgnummer varchar(50)
|
|
|
-- Gets: @semail varchar(50)
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_mitarbeiter_Update]
|
|
|
@imitarbeiternr int,
|
|
|
@svorname varchar(50),
|
|
|
@sname varchar(50),
|
|
|
@stgnummer varchar(50),
|
|
|
@semail varchar(50),
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[mitarbeiter]
|
|
|
SET
|
|
|
[vorname] = @svorname,
|
|
|
[name] = @sname,
|
|
|
[tgnummer] = @stgnummer,
|
|
|
[email] = @semail,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[mitarbeiternr] = @imitarbeiternr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenz_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Pendenz'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iPendenzNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenz_Delete]
|
|
|
@iPendenzNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Pendenz]
|
|
|
WHERE
|
|
|
[PendenzNr] = @iPendenzNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenz_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Pendenz'
|
|
|
-- Gets: @iPendenzNr int
|
|
|
-- Gets: @iThemanr int
|
|
|
-- Gets: @sVerantwortlich varchar(50)
|
|
|
-- Gets: @iPendenzStatusNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @daTermin datetime
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iMandantNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenz_Insert]
|
|
|
@iPendenzNr int,
|
|
|
@iThemanr int,
|
|
|
@sVerantwortlich varchar(50),
|
|
|
@iPendenzStatusNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@daTermin datetime,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iMandantNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Pendenz]
|
|
|
(
|
|
|
[PendenzNr],
|
|
|
[Themanr],
|
|
|
[Verantwortlich],
|
|
|
[PendenzStatusNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Termin],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[MandantNr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iPendenzNr,
|
|
|
@iThemanr,
|
|
|
@sVerantwortlich,
|
|
|
@iPendenzStatusNr,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@daTermin,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@iMandantNr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenz_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Pendenz'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenz_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[PendenzNr],
|
|
|
[Themanr],
|
|
|
[Verantwortlich],
|
|
|
[PendenzStatusNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Termin],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[Pendenz]
|
|
|
ORDER BY
|
|
|
[PendenzNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_pendenz_selectall_bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[pr_pendenz_selectall_bottomtable]
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Kuendigungsfrist'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int,
|
|
|
@mitarbeiternr int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.VertragselementNr, dbo.Pendenz.PendenzStatusNr, dbo.Pendenzstatus.Bezeichnung AS Pendenz_Status,
|
|
|
dbo.Pendenz.Bezeichnung AS Pendenz_Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.pendenz.Verantwortlich, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am,
|
|
|
dbo.Pendenz.Mutiert_am, dbo.Pendenz.Mutierer, dbo.Pendenz.SecurityLevelNr
|
|
|
FROM dbo.Pendenz INNER JOIN
|
|
|
dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr
|
|
|
where dbo.Pendenz.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr) and vertragselementnr = @keyvalue
|
|
|
ORDER BY
|
|
|
[Pendenznr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenz_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Pendenz'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iPendenzNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenz_SelectOne]
|
|
|
@iPendenzNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[PendenzNr],
|
|
|
[Themanr],
|
|
|
[Verantwortlich],
|
|
|
[PendenzStatusNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[Termin],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[MandantNr]
|
|
|
FROM [dbo].[Pendenz]
|
|
|
WHERE
|
|
|
[PendenzNr] = @iPendenzNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenz_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Pendenz'
|
|
|
-- Gets: @iPendenzNr int
|
|
|
-- Gets: @iThemanr int
|
|
|
-- Gets: @sVerantwortlich varchar(50)
|
|
|
-- Gets: @iPendenzStatusNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @daTermin datetime
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iMandantNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenz_Update]
|
|
|
@iPendenzNr int,
|
|
|
@iThemanr int,
|
|
|
@sVerantwortlich varchar(50),
|
|
|
@iPendenzStatusNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@daTermin datetime,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iMandantNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Pendenz]
|
|
|
SET
|
|
|
[Themanr] = @iThemanr,
|
|
|
[Verantwortlich] = @sVerantwortlich,
|
|
|
[PendenzStatusNr] = @iPendenzStatusNr,
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Termin] = @daTermin,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[MandantNr] = @iMandantNr
|
|
|
WHERE
|
|
|
[PendenzNr] = @iPendenzNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenzstatus_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Pendenzstatus'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iPendenzStatusNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenzstatus_Delete]
|
|
|
@iPendenzStatusNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Pendenzstatus]
|
|
|
WHERE
|
|
|
[PendenzStatusNr] = @iPendenzStatusNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenzstatus_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Pendenzstatus'
|
|
|
-- Gets: @iPendenzStatusNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iMandantnr int
|
|
|
-- Gets: @bPendenz_Aktivieren bit
|
|
|
-- Gets: @bPendenz_Inaktivieren bit
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenzstatus_Insert]
|
|
|
@iPendenzStatusNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iMandantnr int,
|
|
|
@bPendenz_Aktivieren bit,
|
|
|
@bPendenz_Inaktivieren bit,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Pendenzstatus]
|
|
|
(
|
|
|
[PendenzStatusNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Mandantnr],
|
|
|
[Pendenz_Aktivieren],
|
|
|
[Pendenz_Inaktivieren]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iPendenzStatusNr,
|
|
|
@sBezeichnung,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@iMandantnr,
|
|
|
@bPendenz_Aktivieren,
|
|
|
@bPendenz_Inaktivieren
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenzstatus_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Pendenzstatus'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenzstatus_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[PendenzStatusNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Mandantnr],
|
|
|
[Pendenz_Aktivieren],
|
|
|
[Pendenz_Inaktivieren]
|
|
|
FROM [dbo].[Pendenzstatus]
|
|
|
ORDER BY
|
|
|
[PendenzStatusNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenzstatus_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Pendenzstatus'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iPendenzStatusNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenzstatus_SelectOne]
|
|
|
@iPendenzStatusNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[PendenzStatusNr],
|
|
|
[Bezeichnung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Mandantnr],
|
|
|
[Pendenz_Aktivieren],
|
|
|
[Pendenz_Inaktivieren]
|
|
|
FROM [dbo].[Pendenzstatus]
|
|
|
WHERE
|
|
|
[PendenzStatusNr] = @iPendenzStatusNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Pendenzstatus_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Pendenzstatus'
|
|
|
-- Gets: @iPendenzStatusNr int
|
|
|
-- Gets: @sBezeichnung varchar(50)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iMandantnr int
|
|
|
-- Gets: @bPendenz_Aktivieren bit
|
|
|
-- Gets: @bPendenz_Inaktivieren bit
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Pendenzstatus_Update]
|
|
|
@iPendenzStatusNr int,
|
|
|
@sBezeichnung varchar(50),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iMandantnr int,
|
|
|
@bPendenz_Aktivieren bit,
|
|
|
@bPendenz_Inaktivieren bit,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Pendenzstatus]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Mandantnr] = @iMandantnr,
|
|
|
[Pendenz_Aktivieren] = @bPendenz_Aktivieren,
|
|
|
[Pendenz_Inaktivieren] = @bPendenz_Inaktivieren
|
|
|
WHERE
|
|
|
[PendenzStatusNr] = @iPendenzStatusNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Person_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Person'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iPersonNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Person_Delete]
|
|
|
@iPersonNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Person]
|
|
|
WHERE
|
|
|
[PersonNr] = @iPersonNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Person_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Person'
|
|
|
-- Gets: @iPersonNr int
|
|
|
-- Gets: @sFirma varchar(50)
|
|
|
-- Gets: @sName varchar(50)
|
|
|
-- Gets: @sVorname varchar(50)
|
|
|
-- Gets: @sStrasse varchar(50)
|
|
|
-- Gets: @sPostfach varchar(50)
|
|
|
-- Gets: @sPlz varchar(50)
|
|
|
-- Gets: @sOrt varchar(50)
|
|
|
-- Gets: @sTelefon varchar(50)
|
|
|
-- Gets: @sTelefax varchar(50)
|
|
|
-- Gets: @sEMail varchar(50)
|
|
|
-- Gets: @sInternet varchar(50)
|
|
|
-- Gets: @sBemerkung varchar(255)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Person_Insert]
|
|
|
@iPersonNr int,
|
|
|
@sFirma varchar(50),
|
|
|
@sName varchar(50),
|
|
|
@sVorname varchar(50),
|
|
|
@sStrasse varchar(50),
|
|
|
@sPostfach varchar(50),
|
|
|
@sPlz varchar(50),
|
|
|
@sOrt varchar(50),
|
|
|
@sTelefon varchar(50),
|
|
|
@sTelefax varchar(50),
|
|
|
@sEMail varchar(50),
|
|
|
@sInternet varchar(50),
|
|
|
@sBemerkung varchar(255),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Person]
|
|
|
(
|
|
|
[PersonNr],
|
|
|
[Firma],
|
|
|
[Name],
|
|
|
[Vorname],
|
|
|
[Strasse],
|
|
|
[Postfach],
|
|
|
[Plz],
|
|
|
[Ort],
|
|
|
[Telefon],
|
|
|
[Telefax],
|
|
|
[EMail],
|
|
|
[Internet],
|
|
|
[Bemerkung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iPersonNr,
|
|
|
@sFirma,
|
|
|
@sName,
|
|
|
@sVorname,
|
|
|
@sStrasse,
|
|
|
@sPostfach,
|
|
|
@sPlz,
|
|
|
@sOrt,
|
|
|
@sTelefon,
|
|
|
@sTelefax,
|
|
|
@sEMail,
|
|
|
@sInternet,
|
|
|
@sBemerkung,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Person_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Person'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Person_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[PersonNr],
|
|
|
[Firma],
|
|
|
[Name],
|
|
|
[Vorname],
|
|
|
[Strasse],
|
|
|
[Postfach],
|
|
|
[Plz],
|
|
|
[Ort],
|
|
|
[Telefon],
|
|
|
[Telefax],
|
|
|
[EMail],
|
|
|
[Internet],
|
|
|
[Bemerkung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[Person]
|
|
|
ORDER BY
|
|
|
[PersonNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Person_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Person'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iPersonNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Person_SelectOne]
|
|
|
@iPersonNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[PersonNr],
|
|
|
[Firma],
|
|
|
[Name],
|
|
|
[Vorname],
|
|
|
[Strasse],
|
|
|
[Postfach],
|
|
|
[Plz],
|
|
|
[Ort],
|
|
|
[Telefon],
|
|
|
[Telefax],
|
|
|
[EMail],
|
|
|
[Internet],
|
|
|
[Bemerkung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[Person]
|
|
|
WHERE
|
|
|
[PersonNr] = @iPersonNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Person_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Person'
|
|
|
-- Gets: @iPersonNr int
|
|
|
-- Gets: @sFirma varchar(50)
|
|
|
-- Gets: @sName varchar(50)
|
|
|
-- Gets: @sVorname varchar(50)
|
|
|
-- Gets: @sStrasse varchar(50)
|
|
|
-- Gets: @sPostfach varchar(50)
|
|
|
-- Gets: @sPlz varchar(50)
|
|
|
-- Gets: @sOrt varchar(50)
|
|
|
-- Gets: @sTelefon varchar(50)
|
|
|
-- Gets: @sTelefax varchar(50)
|
|
|
-- Gets: @sEMail varchar(50)
|
|
|
-- Gets: @sInternet varchar(50)
|
|
|
-- Gets: @sBemerkung varchar(255)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Person_Update]
|
|
|
@iPersonNr int,
|
|
|
@sFirma varchar(50),
|
|
|
@sName varchar(50),
|
|
|
@sVorname varchar(50),
|
|
|
@sStrasse varchar(50),
|
|
|
@sPostfach varchar(50),
|
|
|
@sPlz varchar(50),
|
|
|
@sOrt varchar(50),
|
|
|
@sTelefon varchar(50),
|
|
|
@sTelefax varchar(50),
|
|
|
@sEMail varchar(50),
|
|
|
@sInternet varchar(50),
|
|
|
@sBemerkung varchar(255),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Person]
|
|
|
SET
|
|
|
[Firma] = @sFirma,
|
|
|
[Name] = @sName,
|
|
|
[Vorname] = @sVorname,
|
|
|
[Strasse] = @sStrasse,
|
|
|
[Postfach] = @sPostfach,
|
|
|
[Plz] = @sPlz,
|
|
|
[Ort] = @sOrt,
|
|
|
[Telefon] = @sTelefon,
|
|
|
[Telefax] = @sTelefax,
|
|
|
[EMail] = @sEMail,
|
|
|
[Internet] = @sInternet,
|
|
|
[Bemerkung] = @sBemerkung,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[PersonNr] = @iPersonNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'rolle'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @irollenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_Delete]
|
|
|
@irollenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[rolle]
|
|
|
WHERE
|
|
|
[rollenr] = @irollenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'rolle'
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @sbezeichnung varchar(255)
|
|
|
-- Gets: @sbeschreibung varchar(255)
|
|
|
-- Gets: @bsysadminrolle bit
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_Insert]
|
|
|
@irollenr int,
|
|
|
@sbezeichnung varchar(255),
|
|
|
@sbeschreibung varchar(255),
|
|
|
@bsysadminrolle bit,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[rolle]
|
|
|
(
|
|
|
[rollenr],
|
|
|
[bezeichnung],
|
|
|
[beschreibung],
|
|
|
[sysadminrolle],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@irollenr,
|
|
|
@sbezeichnung,
|
|
|
@sbeschreibung,
|
|
|
@bsysadminrolle,
|
|
|
@imandantnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Rolle_SecurityObject_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Rolle_SecurityObject'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @irolle_securityobjectnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Rolle_SecurityObject_Delete]
|
|
|
@irolle_securityobjectnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Rolle_SecurityObject]
|
|
|
WHERE
|
|
|
[rolle_securityobjectnr] = @irolle_securityobjectnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Rolle_SecurityObject_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Rolle_SecurityObject'
|
|
|
-- Gets: @irolle_securityobjectnr int
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @isecurityobjectnr int
|
|
|
-- Gets: @breadonly bit
|
|
|
-- Gets: @binvisible bit
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Rolle_SecurityObject_Insert]
|
|
|
@irolle_securityobjectnr int,
|
|
|
@irollenr int,
|
|
|
@isecurityobjectnr int,
|
|
|
@breadonly bit,
|
|
|
@binvisible bit,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@imandantnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Rolle_SecurityObject]
|
|
|
(
|
|
|
[rolle_securityobjectnr],
|
|
|
[rollenr],
|
|
|
[securityobjectnr],
|
|
|
[readonly],
|
|
|
[invisible],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@irolle_securityobjectnr,
|
|
|
@irollenr,
|
|
|
@isecurityobjectnr,
|
|
|
@breadonly,
|
|
|
@binvisible,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer,
|
|
|
@imandantnr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Rolle_SecurityObject_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Rolle_SecurityObject'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Rolle_SecurityObject_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[rolle_securityobjectnr],
|
|
|
[rollenr],
|
|
|
[securityobjectnr],
|
|
|
[readonly],
|
|
|
[invisible],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr]
|
|
|
FROM [dbo].[Rolle_SecurityObject]
|
|
|
ORDER BY
|
|
|
[rolle_securityobjectnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_SecurityObject_SelectAll_Bottomtable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
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_rolle_SecurityObject_SelectAll_Bottomtable]
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
|
|
|
if @fokus = 1 begin
|
|
|
SELECT dbo.Rolle_SecurityObject.rolle_securityobjectnr, dbo.Rolle_SecurityObject.rollenr, dbo.rolle.bezeichnung AS Rolle, dbo.Rolle_SecurityObject.securityobjectnr,
|
|
|
dbo.SecurityObject.SecurityForm + '|' + dbo.SecurityObject.SecurityObject + '|' + dbo.SecurityObject.SecurityObjectItem AS SecurityObjectBez,
|
|
|
dbo.Rolle_SecurityObject.readonly, dbo.Rolle_SecurityObject.invisible, dbo.Rolle_SecurityObject.aktiv, dbo.Rolle_SecurityObject.erstellt_am,
|
|
|
dbo.Rolle_SecurityObject.mutiert_am, dbo.Rolle_SecurityObject.mutierer, dbo.Rolle_SecurityObject.mandantnr
|
|
|
FROM dbo.rolle INNER JOIN
|
|
|
dbo.Rolle_SecurityObject ON dbo.rolle.rollenr = dbo.Rolle_SecurityObject.rollenr INNER JOIN
|
|
|
dbo.SecurityObject ON dbo.Rolle_SecurityObject.securityobjectnr = dbo.SecurityObject.SecurityObjectNr
|
|
|
WHERE (dbo.Rolle_SecurityObject.rollenr = @keyvalue)
|
|
|
ORDER BY dbo.Rolle_SecurityObject.rolle_securityobjectnr
|
|
|
end else begin
|
|
|
SELECT dbo.Rolle_SecurityObject.rolle_securityobjectnr, dbo.Rolle_SecurityObject.rollenr, dbo.rolle.bezeichnung AS Rolle, dbo.Rolle_SecurityObject.securityobjectnr,
|
|
|
dbo.SecurityObject.SecurityForm + '|' + dbo.SecurityObject.SecurityObject + '|' + dbo.SecurityObject.SecurityObjectItem AS SecurityObject,
|
|
|
dbo.Rolle_SecurityObject.readonly, dbo.Rolle_SecurityObject.invisible, dbo.Rolle_SecurityObject.aktiv, dbo.Rolle_SecurityObject.erstellt_am,
|
|
|
dbo.Rolle_SecurityObject.mutiert_am, dbo.Rolle_SecurityObject.mutierer, dbo.Rolle_SecurityObject.mandantnr
|
|
|
FROM dbo.rolle INNER JOIN
|
|
|
dbo.Rolle_SecurityObject ON dbo.rolle.rollenr = dbo.Rolle_SecurityObject.rollenr INNER JOIN
|
|
|
dbo.SecurityObject ON dbo.Rolle_SecurityObject.securityobjectnr = dbo.SecurityObject.SecurityObjectNr
|
|
|
WHERE (dbo.Rolle_SecurityObject.SecurityObjectNr = @keyvalue)
|
|
|
ORDER BY dbo.Rolle_SecurityObject.rolle_securityobjectnr
|
|
|
end
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Rolle_SecurityObject_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Rolle_SecurityObject'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @irolle_securityobjectnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Rolle_SecurityObject_SelectOne]
|
|
|
@irolle_securityobjectnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[rolle_securityobjectnr],
|
|
|
[rollenr],
|
|
|
[securityobjectnr],
|
|
|
[readonly],
|
|
|
[invisible],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr]
|
|
|
FROM [dbo].[Rolle_SecurityObject]
|
|
|
WHERE
|
|
|
[rolle_securityobjectnr] = @irolle_securityobjectnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Rolle_SecurityObject_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Rolle_SecurityObject'
|
|
|
-- Gets: @irolle_securityobjectnr int
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @isecurityobjectnr int
|
|
|
-- Gets: @breadonly bit
|
|
|
-- Gets: @binvisible bit
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Rolle_SecurityObject_Update]
|
|
|
@irolle_securityobjectnr int,
|
|
|
@irollenr int,
|
|
|
@isecurityobjectnr int,
|
|
|
@breadonly bit,
|
|
|
@binvisible bit,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@imandantnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Rolle_SecurityObject]
|
|
|
SET
|
|
|
[rollenr] = @irollenr,
|
|
|
[securityobjectnr] = @isecurityobjectnr,
|
|
|
[readonly] = @breadonly,
|
|
|
[invisible] = @binvisible,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer,
|
|
|
[mandantnr] = @imandantnr
|
|
|
WHERE
|
|
|
[rolle_securityobjectnr] = @irolle_securityobjectnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'rolle'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[rollenr],
|
|
|
[bezeichnung],
|
|
|
[beschreibung],
|
|
|
[sysadminrolle],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[rolle]
|
|
|
ORDER BY
|
|
|
[rollenr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'rolle'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @irollenr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_SelectOne]
|
|
|
@irollenr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[rollenr],
|
|
|
[bezeichnung],
|
|
|
[beschreibung],
|
|
|
[sysadminrolle],
|
|
|
[mandantnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[rolle]
|
|
|
WHERE
|
|
|
[rollenr] = @irollenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_sysadminfunktion_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'rolle_sysadminfunktion'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @irolle_sysadminfnktnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_sysadminfunktion_Delete]
|
|
|
@irolle_sysadminfnktnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[rolle_sysadminfunktion]
|
|
|
WHERE
|
|
|
[rolle_sysadminfnktnr] = @irolle_sysadminfnktnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_sysadminfunktion_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'rolle_sysadminfunktion'
|
|
|
-- Gets: @irolle_sysadminfnktnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @isysadminfnktnr int
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @imandant int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_sysadminfunktion_Insert]
|
|
|
@irolle_sysadminfnktnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@isysadminfnktnr int,
|
|
|
@irollenr int,
|
|
|
@imandant int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[rolle_sysadminfunktion]
|
|
|
(
|
|
|
[rolle_sysadminfnktnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[sysadminfnktnr],
|
|
|
[rollenr],
|
|
|
[mandant]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@irolle_sysadminfnktnr,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer,
|
|
|
@isysadminfnktnr,
|
|
|
@irollenr,
|
|
|
@imandant
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_sysadminfunktion_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'rolle_sysadminfunktion'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_sysadminfunktion_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[rolle_sysadminfnktnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[sysadminfnktnr],
|
|
|
[rollenr],
|
|
|
[mandant]
|
|
|
FROM [dbo].[rolle_sysadminfunktion]
|
|
|
ORDER BY
|
|
|
[rolle_sysadminfnktnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_sysadminfunktion_SelectAll_BottomTable] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'rolle_sysadminfunktion'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_sysadminfunktion_SelectAll_BottomTable]
|
|
|
@iErrorCode int OUTPUT,
|
|
|
@Fokus int,
|
|
|
@KeyValue int
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
|
|
|
if @fokus = 1 begin
|
|
|
SELECT dbo.rolle_sysadminfunktion.rolle_sysadminfnktnr, dbo.rolle_sysadminfunktion.sysadminfnktnr,
|
|
|
dbo.sysadminfunktion.bezeichnung AS sysadminfunktion, dbo.rolle_sysadminfunktion.rollenr, dbo.rolle.bezeichnung AS Rolle,
|
|
|
dbo.rolle_sysadminfunktion.aktiv, dbo.rolle_sysadminfunktion.erstellt_am, dbo.rolle_sysadminfunktion.mutiert_am,
|
|
|
dbo.rolle_sysadminfunktion.mutierer, dbo.rolle_sysadminfunktion.mandant
|
|
|
FROM dbo.rolle_sysadminfunktion INNER JOIN
|
|
|
dbo.rolle ON dbo.rolle_sysadminfunktion.rollenr = dbo.rolle.rollenr INNER JOIN
|
|
|
dbo.sysadminfunktion ON dbo.rolle_sysadminfunktion.sysadminfnktnr = dbo.sysadminfunktion.sysadminfnktnr
|
|
|
where rolle_sysadminfunktion.rollenr=@keyvalue
|
|
|
ORDER BY dbo.rolle_sysadminfunktion.rolle_sysadminfnktnr
|
|
|
end else begin
|
|
|
SELECT dbo.rolle_sysadminfunktion.rolle_sysadminfnktnr, dbo.rolle_sysadminfunktion.sysadminfnktnr,
|
|
|
dbo.sysadminfunktion.bezeichnung AS sysadminfunktion, dbo.rolle_sysadminfunktion.rollenr, dbo.rolle.bezeichnung AS Rolle,
|
|
|
dbo.rolle_sysadminfunktion.aktiv, dbo.rolle_sysadminfunktion.erstellt_am, dbo.rolle_sysadminfunktion.mutiert_am,
|
|
|
dbo.rolle_sysadminfunktion.mutierer, dbo.rolle_sysadminfunktion.mandant
|
|
|
FROM dbo.rolle_sysadminfunktion INNER JOIN
|
|
|
dbo.rolle ON dbo.rolle_sysadminfunktion.rollenr = dbo.rolle.rollenr INNER JOIN
|
|
|
dbo.sysadminfunktion ON dbo.rolle_sysadminfunktion.sysadminfnktnr = dbo.sysadminfunktion.sysadminfnktnr
|
|
|
where rolle_sysadminfunktion.sysadminfnktnr=@keyvalue
|
|
|
ORDER BY dbo.rolle_sysadminfunktion.rolle_sysadminfnktnr
|
|
|
end
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_sysadminfunktion_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'rolle_sysadminfunktion'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @irolle_sysadminfnktnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_sysadminfunktion_SelectOne]
|
|
|
@irolle_sysadminfnktnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[rolle_sysadminfnktnr],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[sysadminfnktnr],
|
|
|
[rollenr],
|
|
|
[mandant]
|
|
|
FROM [dbo].[rolle_sysadminfunktion]
|
|
|
WHERE
|
|
|
[rolle_sysadminfnktnr] = @irolle_sysadminfnktnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_sysadminfunktion_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'rolle_sysadminfunktion'
|
|
|
-- Gets: @irolle_sysadminfnktnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @isysadminfnktnr int
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @imandant int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_sysadminfunktion_Update]
|
|
|
@irolle_sysadminfnktnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@isysadminfnktnr int,
|
|
|
@irollenr int,
|
|
|
@imandant int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[rolle_sysadminfunktion]
|
|
|
SET
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer,
|
|
|
[sysadminfnktnr] = @isysadminfnktnr,
|
|
|
[rollenr] = @irollenr,
|
|
|
[mandant] = @imandant
|
|
|
WHERE
|
|
|
[rolle_sysadminfnktnr] = @irolle_sysadminfnktnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_rolle_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'rolle'
|
|
|
-- Gets: @irollenr int
|
|
|
-- Gets: @sbezeichnung varchar(255)
|
|
|
-- Gets: @sbeschreibung varchar(255)
|
|
|
-- Gets: @bsysadminrolle bit
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_rolle_Update]
|
|
|
@irollenr int,
|
|
|
@sbezeichnung varchar(255),
|
|
|
@sbeschreibung varchar(255),
|
|
|
@bsysadminrolle bit,
|
|
|
@imandantnr int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[rolle]
|
|
|
SET
|
|
|
[bezeichnung] = @sbezeichnung,
|
|
|
[beschreibung] = @sbeschreibung,
|
|
|
[sysadminrolle] = @bsysadminrolle,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[rollenr] = @irollenr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SecurityObject_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'SecurityObject'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iSecurityObjectNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SecurityObject_Delete]
|
|
|
@iSecurityObjectNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[SecurityObject]
|
|
|
WHERE
|
|
|
[SecurityObjectNr] = @iSecurityObjectNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SecurityObject_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'SecurityObject'
|
|
|
-- Gets: @iSecurityObjectNr int
|
|
|
-- Gets: @sSecurityForm varchar(50)
|
|
|
-- Gets: @sSecurityObjectType varchar(50)
|
|
|
-- Gets: @sSecurityObject varchar(50)
|
|
|
-- Gets: @sSecurityObjectItem varchar(50)
|
|
|
-- Gets: @sSecurityObjectDescriotion varchar(50)
|
|
|
-- Gets: @iLevel int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iMandantnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SecurityObject_Insert]
|
|
|
@iSecurityObjectNr int,
|
|
|
@sSecurityForm varchar(50),
|
|
|
@sSecurityObjectType varchar(50),
|
|
|
@sSecurityObject varchar(50),
|
|
|
@sSecurityObjectItem varchar(50),
|
|
|
@sSecurityObjectDescriotion varchar(50),
|
|
|
@iLevel int,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iMandantnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[SecurityObject]
|
|
|
(
|
|
|
[SecurityObjectNr],
|
|
|
[SecurityForm],
|
|
|
[SecurityObjectType],
|
|
|
[SecurityObject],
|
|
|
[SecurityObjectItem],
|
|
|
[SecurityObjectDescriotion],
|
|
|
[Level],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Mandantnr]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iSecurityObjectNr,
|
|
|
@sSecurityForm,
|
|
|
@sSecurityObjectType,
|
|
|
@sSecurityObject,
|
|
|
@sSecurityObjectItem,
|
|
|
@sSecurityObjectDescriotion,
|
|
|
@iLevel,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer,
|
|
|
@iMandantnr
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SecurityObject_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'SecurityObject'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SecurityObject_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[SecurityObjectNr],
|
|
|
[SecurityForm],
|
|
|
[SecurityObjectType],
|
|
|
[SecurityObject],
|
|
|
[SecurityObjectItem],
|
|
|
[SecurityObjectDescriotion],
|
|
|
[Level],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Mandantnr]
|
|
|
FROM [dbo].[SecurityObject]
|
|
|
ORDER BY
|
|
|
[SecurityObjectNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SecurityObject_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'SecurityObject'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iSecurityObjectNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SecurityObject_SelectOne]
|
|
|
@iSecurityObjectNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[SecurityObjectNr],
|
|
|
[SecurityForm],
|
|
|
[SecurityObjectType],
|
|
|
[SecurityObject],
|
|
|
[SecurityObjectItem],
|
|
|
[SecurityObjectDescriotion],
|
|
|
[Level],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer],
|
|
|
[Mandantnr]
|
|
|
FROM [dbo].[SecurityObject]
|
|
|
WHERE
|
|
|
[SecurityObjectNr] = @iSecurityObjectNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SecurityObject_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'SecurityObject'
|
|
|
-- Gets: @iSecurityObjectNr int
|
|
|
-- Gets: @sSecurityForm varchar(50)
|
|
|
-- Gets: @sSecurityObjectType varchar(50)
|
|
|
-- Gets: @sSecurityObject varchar(50)
|
|
|
-- Gets: @sSecurityObjectItem varchar(50)
|
|
|
-- Gets: @sSecurityObjectDescriotion varchar(50)
|
|
|
-- Gets: @iLevel int
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Gets: @iMandantnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SecurityObject_Update]
|
|
|
@iSecurityObjectNr int,
|
|
|
@sSecurityForm varchar(50),
|
|
|
@sSecurityObjectType varchar(50),
|
|
|
@sSecurityObject varchar(50),
|
|
|
@sSecurityObjectItem varchar(50),
|
|
|
@sSecurityObjectDescriotion varchar(50),
|
|
|
@iLevel int,
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iMandantnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[SecurityObject]
|
|
|
SET
|
|
|
[SecurityForm] = @sSecurityForm,
|
|
|
[SecurityObjectType] = @sSecurityObjectType,
|
|
|
[SecurityObject] = @sSecurityObject,
|
|
|
[SecurityObjectItem] = @sSecurityObjectItem,
|
|
|
[SecurityObjectDescriotion] = @sSecurityObjectDescriotion,
|
|
|
[Level] = @iLevel,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer,
|
|
|
[Mandantnr] = @iMandantnr
|
|
|
WHERE
|
|
|
[SecurityObjectNr] = @iSecurityObjectNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_spalten_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'spalten'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @ieintragnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_spalten_Delete]
|
|
|
@ieintragnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[spalten]
|
|
|
WHERE
|
|
|
[eintragnr] = @ieintragnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_spalten_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'spalten'
|
|
|
-- Gets: @ieintragnr int
|
|
|
-- Gets: @stabelle varchar(255)
|
|
|
-- Gets: @stabellenspalte varchar(255)
|
|
|
-- Gets: @sspalte varchar(255)
|
|
|
-- Gets: @bReadonly bit
|
|
|
-- Gets: @balsHacken bit
|
|
|
-- Gets: @iBreite int
|
|
|
-- Gets: @iReihenfolge int
|
|
|
-- Gets: @stiptext varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @sNumberFormat varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_spalten_Insert]
|
|
|
@ieintragnr int,
|
|
|
@stabelle varchar(255),
|
|
|
@stabellenspalte varchar(255),
|
|
|
@sspalte varchar(255),
|
|
|
@bReadonly bit,
|
|
|
@balsHacken bit,
|
|
|
@iBreite int,
|
|
|
@iReihenfolge int,
|
|
|
@stiptext varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@imandantnr int,
|
|
|
@sNumberFormat varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[spalten]
|
|
|
(
|
|
|
[eintragnr],
|
|
|
[tabelle],
|
|
|
[tabellenspalte],
|
|
|
[spalte],
|
|
|
[Readonly],
|
|
|
[alsHacken],
|
|
|
[Breite],
|
|
|
[Reihenfolge],
|
|
|
[tiptext],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr],
|
|
|
[NumberFormat]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@ieintragnr,
|
|
|
@stabelle,
|
|
|
@stabellenspalte,
|
|
|
@sspalte,
|
|
|
@bReadonly,
|
|
|
@balsHacken,
|
|
|
@iBreite,
|
|
|
@iReihenfolge,
|
|
|
@stiptext,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer,
|
|
|
@imandantnr,
|
|
|
@sNumberFormat
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_spalten_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'spalten'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_spalten_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[eintragnr],
|
|
|
[tabelle],
|
|
|
[tabellenspalte],
|
|
|
[spalte],
|
|
|
[Readonly],
|
|
|
[alsHacken],
|
|
|
[Breite],
|
|
|
[Reihenfolge],
|
|
|
[tiptext],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr],
|
|
|
[NumberFormat]
|
|
|
FROM [dbo].[spalten]
|
|
|
ORDER BY
|
|
|
[eintragnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_spalten_SelectAll_Aktiv] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[pr_spalten_SelectAll_Aktiv]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[eintragnr],
|
|
|
tabelle,
|
|
|
tabellenspalte,
|
|
|
[spalte],
|
|
|
[Readonly],
|
|
|
[alsHacken],
|
|
|
[Breite],
|
|
|
[Reihenfolge],
|
|
|
[tiptext],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr],
|
|
|
[numberformat]
|
|
|
FROM [dbo].[spalten]
|
|
|
Where aktiv=1
|
|
|
ORDER BY
|
|
|
[eintragnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_spalten_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'spalten'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @ieintragnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_spalten_SelectOne]
|
|
|
@ieintragnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[eintragnr],
|
|
|
[tabelle],
|
|
|
[tabellenspalte],
|
|
|
[spalte],
|
|
|
[Readonly],
|
|
|
[alsHacken],
|
|
|
[Breite],
|
|
|
[Reihenfolge],
|
|
|
[tiptext],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[mandantnr],
|
|
|
[NumberFormat]
|
|
|
FROM [dbo].[spalten]
|
|
|
WHERE
|
|
|
[eintragnr] = @ieintragnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_spalten_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'spalten'
|
|
|
-- Gets: @ieintragnr int
|
|
|
-- Gets: @stabelle varchar(255)
|
|
|
-- Gets: @stabellenspalte varchar(255)
|
|
|
-- Gets: @sspalte varchar(255)
|
|
|
-- Gets: @bReadonly bit
|
|
|
-- Gets: @balsHacken bit
|
|
|
-- Gets: @iBreite int
|
|
|
-- Gets: @iReihenfolge int
|
|
|
-- Gets: @stiptext varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @sNumberFormat varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_spalten_Update]
|
|
|
@ieintragnr int,
|
|
|
@stabelle varchar(255),
|
|
|
@stabellenspalte varchar(255),
|
|
|
@sspalte varchar(255),
|
|
|
@bReadonly bit,
|
|
|
@balsHacken bit,
|
|
|
@iBreite int,
|
|
|
@iReihenfolge int,
|
|
|
@stiptext varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@imandantnr int,
|
|
|
@sNumberFormat varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[spalten]
|
|
|
SET
|
|
|
[tabelle] = @stabelle,
|
|
|
[tabellenspalte] = @stabellenspalte,
|
|
|
[spalte] = @sspalte,
|
|
|
[Readonly] = @bReadonly,
|
|
|
[alsHacken] = @balsHacken,
|
|
|
[Breite] = @iBreite,
|
|
|
[Reihenfolge] = @iReihenfolge,
|
|
|
[tiptext] = @stiptext,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[NumberFormat] = @sNumberFormat
|
|
|
WHERE
|
|
|
[eintragnr] = @ieintragnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SpeicherTyp_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'SpeicherTyp'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iSpeicherTypNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SpeicherTyp_Delete]
|
|
|
@iSpeicherTypNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[SpeicherTyp]
|
|
|
WHERE
|
|
|
[SpeicherTypNr] = @iSpeicherTypNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SpeicherTyp_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'SpeicherTyp'
|
|
|
-- Gets: @iSpeicherTypNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SpeicherTyp_Insert]
|
|
|
@iSpeicherTypNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[SpeicherTyp]
|
|
|
(
|
|
|
[SpeicherTypNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iSpeicherTypNr,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SpeicherTyp_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'SpeicherTyp'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SpeicherTyp_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[SpeicherTypNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[SpeicherTyp]
|
|
|
ORDER BY
|
|
|
[SpeicherTypNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SpeicherTyp_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'SpeicherTyp'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iSpeicherTypNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SpeicherTyp_SelectOne]
|
|
|
@iSpeicherTypNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[SpeicherTypNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[SpeicherTyp]
|
|
|
WHERE
|
|
|
[SpeicherTypNr] = @iSpeicherTypNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_SpeicherTyp_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'SpeicherTyp'
|
|
|
-- Gets: @iSpeicherTypNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_SpeicherTyp_Update]
|
|
|
@iSpeicherTypNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[SpeicherTyp]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[SpeicherTypNr] = @iSpeicherTypNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_sysadminfunktion_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'sysadminfunktion'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @isysadminfnktnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_sysadminfunktion_Delete]
|
|
|
@isysadminfnktnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[sysadminfunktion]
|
|
|
WHERE
|
|
|
[sysadminfnktnr] = @isysadminfnktnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_sysadminfunktion_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'sysadminfunktion'
|
|
|
-- Gets: @isysadminfnktnr int
|
|
|
-- Gets: @sbezeichnung varchar(255)
|
|
|
-- Gets: @iParentID int
|
|
|
-- Gets: @iSort int
|
|
|
-- Gets: @iImageIndex int
|
|
|
-- Gets: @iImageIndexOpen int
|
|
|
-- Gets: @iftop int
|
|
|
-- Gets: @ifleft int
|
|
|
-- Gets: @ifwidth int
|
|
|
-- Gets: @ifheight int
|
|
|
-- Gets: @sbeschreibung varchar(255)
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @isprache int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @sDomaintable varchar(255)
|
|
|
-- Gets: @sKeyFields varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_sysadminfunktion_Insert]
|
|
|
@isysadminfnktnr int,
|
|
|
@sbezeichnung varchar(255),
|
|
|
@iParentID int,
|
|
|
@iSort int,
|
|
|
@iImageIndex int,
|
|
|
@iImageIndexOpen int,
|
|
|
@iftop int,
|
|
|
@ifleft int,
|
|
|
@ifwidth int,
|
|
|
@ifheight int,
|
|
|
@sbeschreibung varchar(255),
|
|
|
@imandantnr int,
|
|
|
@isprache int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@sDomaintable varchar(255),
|
|
|
@sKeyFields varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[sysadminfunktion]
|
|
|
(
|
|
|
[sysadminfnktnr],
|
|
|
[bezeichnung],
|
|
|
[ParentID],
|
|
|
[Sort],
|
|
|
[ImageIndex],
|
|
|
[ImageIndexOpen],
|
|
|
[ftop],
|
|
|
[fleft],
|
|
|
[fwidth],
|
|
|
[fheight],
|
|
|
[beschreibung],
|
|
|
[mandantnr],
|
|
|
[sprache],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[Domaintable],
|
|
|
[KeyFields]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@isysadminfnktnr,
|
|
|
@sbezeichnung,
|
|
|
@iParentID,
|
|
|
@iSort,
|
|
|
@iImageIndex,
|
|
|
@iImageIndexOpen,
|
|
|
@iftop,
|
|
|
@ifleft,
|
|
|
@ifwidth,
|
|
|
@ifheight,
|
|
|
@sbeschreibung,
|
|
|
@imandantnr,
|
|
|
@isprache,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer,
|
|
|
@sDomaintable,
|
|
|
@sKeyFields
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_sysadminfunktion_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'sysadminfunktion'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_sysadminfunktion_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[sysadminfnktnr],
|
|
|
[bezeichnung],
|
|
|
[ParentID],
|
|
|
[Sort],
|
|
|
[ImageIndex],
|
|
|
[ImageIndexOpen],
|
|
|
[ftop],
|
|
|
[fleft],
|
|
|
[fwidth],
|
|
|
[fheight],
|
|
|
[beschreibung],
|
|
|
[mandantnr],
|
|
|
[sprache],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[Domaintable],
|
|
|
[KeyFields]
|
|
|
FROM [dbo].[sysadminfunktion]
|
|
|
ORDER BY
|
|
|
[sysadminfnktnr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_sysadminfunktion_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'sysadminfunktion'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @isysadminfnktnr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_sysadminfunktion_SelectOne]
|
|
|
@isysadminfnktnr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[sysadminfnktnr],
|
|
|
[bezeichnung],
|
|
|
[ParentID],
|
|
|
[Sort],
|
|
|
[ImageIndex],
|
|
|
[ImageIndexOpen],
|
|
|
[ftop],
|
|
|
[fleft],
|
|
|
[fwidth],
|
|
|
[fheight],
|
|
|
[beschreibung],
|
|
|
[mandantnr],
|
|
|
[sprache],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer],
|
|
|
[Domaintable],
|
|
|
[KeyFields]
|
|
|
FROM [dbo].[sysadminfunktion]
|
|
|
WHERE
|
|
|
[sysadminfnktnr] = @isysadminfnktnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_sysadminfunktion_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'sysadminfunktion'
|
|
|
-- Gets: @isysadminfnktnr int
|
|
|
-- Gets: @sbezeichnung varchar(255)
|
|
|
-- Gets: @iParentID int
|
|
|
-- Gets: @iSort int
|
|
|
-- Gets: @iImageIndex int
|
|
|
-- Gets: @iImageIndexOpen int
|
|
|
-- Gets: @iftop int
|
|
|
-- Gets: @ifleft int
|
|
|
-- Gets: @ifwidth int
|
|
|
-- Gets: @ifheight int
|
|
|
-- Gets: @sbeschreibung varchar(255)
|
|
|
-- Gets: @imandantnr int
|
|
|
-- Gets: @isprache int
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Gets: @sDomaintable varchar(255)
|
|
|
-- Gets: @sKeyFields varchar(255)
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_sysadminfunktion_Update]
|
|
|
@isysadminfnktnr int,
|
|
|
@sbezeichnung varchar(255),
|
|
|
@iParentID int,
|
|
|
@iSort int,
|
|
|
@iImageIndex int,
|
|
|
@iImageIndexOpen int,
|
|
|
@iftop int,
|
|
|
@ifleft int,
|
|
|
@ifwidth int,
|
|
|
@ifheight int,
|
|
|
@sbeschreibung varchar(255),
|
|
|
@imandantnr int,
|
|
|
@isprache int,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@sDomaintable varchar(255),
|
|
|
@sKeyFields varchar(255),
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[sysadminfunktion]
|
|
|
SET
|
|
|
[bezeichnung] = @sbezeichnung,
|
|
|
[ParentID] = @iParentID,
|
|
|
[Sort] = @iSort,
|
|
|
[ImageIndex] = @iImageIndex,
|
|
|
[ImageIndexOpen] = @iImageIndexOpen,
|
|
|
[ftop] = @iftop,
|
|
|
[fleft] = @ifleft,
|
|
|
[fwidth] = @ifwidth,
|
|
|
[fheight] = @ifheight,
|
|
|
[beschreibung] = @sbeschreibung,
|
|
|
[mandantnr] = @imandantnr,
|
|
|
[sprache] = @isprache,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer,
|
|
|
[Domaintable] = @sDomaintable,
|
|
|
[KeyFields] = @sKeyFields
|
|
|
WHERE
|
|
|
[sysadminfnktnr] = @isysadminfnktnr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Thema_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Thema'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iThemanNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Thema_Delete]
|
|
|
@iThemanNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Thema]
|
|
|
WHERE
|
|
|
[ThemanNr] = @iThemanNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Thema_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Thema'
|
|
|
-- Gets: @iThemanNr int
|
|
|
-- Gets: @sTitel varchar(255)
|
|
|
-- Gets: @iKategorieNr int
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @sSuchbegriffe varchar(1024)
|
|
|
-- Gets: @daGueltig_ab datetime
|
|
|
-- Gets: @daGueltig_bis datetime
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Thema_Insert]
|
|
|
@iThemanNr int,
|
|
|
@sTitel varchar(255),
|
|
|
@iKategorieNr int,
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@sSuchbegriffe varchar(1024),
|
|
|
@daGueltig_ab datetime,
|
|
|
@daGueltig_bis datetime,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Thema]
|
|
|
(
|
|
|
[ThemanNr],
|
|
|
[Titel],
|
|
|
[KategorieNr],
|
|
|
[Beschreibung],
|
|
|
[Suchbegriffe],
|
|
|
[Gueltig_ab],
|
|
|
[Gueltig_bis],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iThemanNr,
|
|
|
@sTitel,
|
|
|
@iKategorieNr,
|
|
|
@sBeschreibung,
|
|
|
@sSuchbegriffe,
|
|
|
@daGueltig_ab,
|
|
|
@daGueltig_bis,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Thema_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Thema'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Thema_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
--SELECT
|
|
|
-- [ThemanNr],
|
|
|
-- [Titel],
|
|
|
-- [KategorieNr],
|
|
|
-- [Beschreibung],
|
|
|
-- [Suchbegriffe],
|
|
|
-- [Gueltig_ab],
|
|
|
-- [Gueltig_bis],
|
|
|
-- [aktiv],
|
|
|
-- [erstellt_am],
|
|
|
-- [mutiert_am],
|
|
|
-- [mutierer]
|
|
|
--FROM [dbo].[Thema]
|
|
|
--ORDER BY
|
|
|
-- [ThemanNr] ASC
|
|
|
---- Get the Error Code for the statement just executed.
|
|
|
|
|
|
SELECT dbo.Thema.*, dbo.Kategorie.Bezeichnung AS Kategorie
|
|
|
FROM dbo.Thema INNER JOIN
|
|
|
dbo.Kategorie ON dbo.Thema.KategorieNr = dbo.Kategorie.KategorieNr
|
|
|
ORDER BY Titel
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Thema_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Thema'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iThemanNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Thema_SelectOne]
|
|
|
@iThemanNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[ThemanNr],
|
|
|
[Titel],
|
|
|
[KategorieNr],
|
|
|
[Beschreibung],
|
|
|
[Suchbegriffe],
|
|
|
[Gueltig_ab],
|
|
|
[Gueltig_bis],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Thema]
|
|
|
WHERE
|
|
|
[ThemanNr] = @iThemanNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Thema_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Thema'
|
|
|
-- Gets: @iThemanNr int
|
|
|
-- Gets: @sTitel varchar(255)
|
|
|
-- Gets: @iKategorieNr int
|
|
|
-- Gets: @sBeschreibung varchar(1024)
|
|
|
-- Gets: @sSuchbegriffe varchar(1024)
|
|
|
-- Gets: @daGueltig_ab datetime
|
|
|
-- Gets: @daGueltig_bis datetime
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Thema_Update]
|
|
|
@iThemanNr int,
|
|
|
@sTitel varchar(255),
|
|
|
@iKategorieNr int,
|
|
|
@sBeschreibung varchar(1024),
|
|
|
@sSuchbegriffe varchar(1024),
|
|
|
@daGueltig_ab datetime,
|
|
|
@daGueltig_bis datetime,
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Thema]
|
|
|
SET
|
|
|
[Titel] = @sTitel,
|
|
|
[KategorieNr] = @iKategorieNr,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[Suchbegriffe] = @sSuchbegriffe,
|
|
|
[Gueltig_ab] = @daGueltig_ab,
|
|
|
[Gueltig_bis] = @daGueltig_bis,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[ThemanNr] = @iThemanNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaEntwicklung_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'ThemaEntwicklung'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iThemaEntwicklungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaEntwicklung_Delete]
|
|
|
@iThemaEntwicklungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[ThemaEntwicklung]
|
|
|
WHERE
|
|
|
[ThemaEntwicklungNr] = @iThemaEntwicklungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaEntwicklung_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'ThemaEntwicklung'
|
|
|
-- Gets: @iThemaEntwicklungNr int
|
|
|
-- Gets: @iThemaNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @blobDokument image
|
|
|
-- Gets: @sRTFText varchar(-1)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaEntwicklung_Insert]
|
|
|
@iThemaEntwicklungNr int,
|
|
|
@iThemaNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@blobDokument image,
|
|
|
@sRTFText varchar(max),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[ThemaEntwicklung]
|
|
|
(
|
|
|
[ThemaEntwicklungNr],
|
|
|
[ThemaNr],
|
|
|
[Bezeichnung],
|
|
|
[Dokument],
|
|
|
[RTFText],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iThemaEntwicklungNr,
|
|
|
@iThemaNr,
|
|
|
@sBezeichnung,
|
|
|
@blobDokument,
|
|
|
@sRTFText,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaEntwicklung_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'ThemaEntwicklung'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaEntwicklung_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[ThemaEntwicklungNr],
|
|
|
[ThemaNr],
|
|
|
[Bezeichnung],
|
|
|
[Dokument],
|
|
|
[RTFText],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[ThemaEntwicklung]
|
|
|
ORDER BY
|
|
|
[ThemaEntwicklungNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaEntwicklung_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'ThemaEntwicklung'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iThemaEntwicklungNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaEntwicklung_SelectOne]
|
|
|
@iThemaEntwicklungNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[ThemaEntwicklungNr],
|
|
|
[ThemaNr],
|
|
|
[Bezeichnung],
|
|
|
[Dokument],
|
|
|
[RTFText],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[ThemaEntwicklung]
|
|
|
WHERE
|
|
|
[ThemaEntwicklungNr] = @iThemaEntwicklungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaEntwicklung_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'ThemaEntwicklung'
|
|
|
-- Gets: @iThemaEntwicklungNr int
|
|
|
-- Gets: @iThemaNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @blobDokument image
|
|
|
-- Gets: @sRTFText varchar(-1)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaEntwicklung_Update]
|
|
|
@iThemaEntwicklungNr int,
|
|
|
@iThemaNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@blobDokument image,
|
|
|
@sRTFText varchar(max),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[ThemaEntwicklung]
|
|
|
SET
|
|
|
[ThemaNr] = @iThemaNr,
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Dokument] = @blobDokument,
|
|
|
[RTFText] = @sRTFText,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[ThemaEntwicklungNr] = @iThemaEntwicklungNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaPerson_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'ThemaPerson'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iThemaPersonNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaPerson_Delete]
|
|
|
@iThemaPersonNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[ThemaPerson]
|
|
|
WHERE
|
|
|
[ThemaPersonNr] = @iThemaPersonNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaPerson_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'ThemaPerson'
|
|
|
-- Gets: @iThemaPersonNr int
|
|
|
-- Gets: @iThemaNr int
|
|
|
-- Gets: @iPersonNr int
|
|
|
-- Gets: @iFunktionNr int
|
|
|
-- Gets: @sBemerkung varchar(255)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaPerson_Insert]
|
|
|
@iThemaPersonNr int,
|
|
|
@iThemaNr int,
|
|
|
@iPersonNr int,
|
|
|
@iFunktionNr int,
|
|
|
@sBemerkung varchar(255),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[ThemaPerson]
|
|
|
(
|
|
|
[ThemaPersonNr],
|
|
|
[ThemaNr],
|
|
|
[PersonNr],
|
|
|
[FunktionNr],
|
|
|
[Bemerkung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iThemaPersonNr,
|
|
|
@iThemaNr,
|
|
|
@iPersonNr,
|
|
|
@iFunktionNr,
|
|
|
@sBemerkung,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaPerson_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'ThemaPerson'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaPerson_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[ThemaPersonNr],
|
|
|
[ThemaNr],
|
|
|
[PersonNr],
|
|
|
[FunktionNr],
|
|
|
[Bemerkung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[ThemaPerson]
|
|
|
ORDER BY
|
|
|
[ThemaPersonNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaPerson_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'ThemaPerson'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iThemaPersonNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaPerson_SelectOne]
|
|
|
@iThemaPersonNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[ThemaPersonNr],
|
|
|
[ThemaNr],
|
|
|
[PersonNr],
|
|
|
[FunktionNr],
|
|
|
[Bemerkung],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[ThemaPerson]
|
|
|
WHERE
|
|
|
[ThemaPersonNr] = @iThemaPersonNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ThemaPerson_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'ThemaPerson'
|
|
|
-- Gets: @iThemaPersonNr int
|
|
|
-- Gets: @iThemaNr int
|
|
|
-- Gets: @iPersonNr int
|
|
|
-- Gets: @iFunktionNr int
|
|
|
-- Gets: @sBemerkung varchar(255)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ThemaPerson_Update]
|
|
|
@iThemaPersonNr int,
|
|
|
@iThemaNr int,
|
|
|
@iPersonNr int,
|
|
|
@iFunktionNr int,
|
|
|
@sBemerkung varchar(255),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[ThemaPerson]
|
|
|
SET
|
|
|
[ThemaNr] = @iThemaNr,
|
|
|
[PersonNr] = @iPersonNr,
|
|
|
[FunktionNr] = @iFunktionNr,
|
|
|
[Bemerkung] = @sBemerkung,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[ThemaPersonNr] = @iThemaPersonNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ToolTip_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'ToolTip'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iToolTipNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ToolTip_Delete]
|
|
|
@iToolTipNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[ToolTip]
|
|
|
WHERE
|
|
|
[ToolTipNr] = @iToolTipNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ToolTip_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'ToolTip'
|
|
|
-- Gets: @iToolTipNr int
|
|
|
-- Gets: @sFormularName varchar(50)
|
|
|
-- Gets: @sControlName varchar(50)
|
|
|
-- Gets: @sToolTip varchar(1024)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ToolTip_Insert]
|
|
|
@iToolTipNr int,
|
|
|
@sFormularName varchar(50),
|
|
|
@sControlName varchar(50),
|
|
|
@sToolTip varchar(1024),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[ToolTip]
|
|
|
(
|
|
|
[ToolTipNr],
|
|
|
[FormularName],
|
|
|
[ControlName],
|
|
|
[ToolTip],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iToolTipNr,
|
|
|
@sFormularName,
|
|
|
@sControlName,
|
|
|
@sToolTip,
|
|
|
@bAktiv,
|
|
|
@daErstellt_am,
|
|
|
@daMutiert_am,
|
|
|
@iMutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ToolTip_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'ToolTip'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ToolTip_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[ToolTipNr],
|
|
|
[FormularName],
|
|
|
[ControlName],
|
|
|
[ToolTip],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[ToolTip]
|
|
|
ORDER BY
|
|
|
[ToolTipNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ToolTip_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'ToolTip'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iToolTipNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ToolTip_SelectOne]
|
|
|
@iToolTipNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[ToolTipNr],
|
|
|
[FormularName],
|
|
|
[ControlName],
|
|
|
[ToolTip],
|
|
|
[Aktiv],
|
|
|
[Erstellt_am],
|
|
|
[Mutiert_am],
|
|
|
[Mutierer]
|
|
|
FROM [dbo].[ToolTip]
|
|
|
WHERE
|
|
|
[ToolTipNr] = @iToolTipNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_ToolTip_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'ToolTip'
|
|
|
-- Gets: @iToolTipNr int
|
|
|
-- Gets: @sFormularName varchar(50)
|
|
|
-- Gets: @sControlName varchar(50)
|
|
|
-- Gets: @sToolTip varchar(1024)
|
|
|
-- Gets: @bAktiv bit
|
|
|
-- Gets: @daErstellt_am datetime
|
|
|
-- Gets: @daMutiert_am datetime
|
|
|
-- Gets: @iMutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_ToolTip_Update]
|
|
|
@iToolTipNr int,
|
|
|
@sFormularName varchar(50),
|
|
|
@sControlName varchar(50),
|
|
|
@sToolTip varchar(1024),
|
|
|
@bAktiv bit,
|
|
|
@daErstellt_am datetime,
|
|
|
@daMutiert_am datetime,
|
|
|
@iMutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[ToolTip]
|
|
|
SET
|
|
|
[FormularName] = @sFormularName,
|
|
|
[ControlName] = @sControlName,
|
|
|
[ToolTip] = @sToolTip,
|
|
|
[Aktiv] = @bAktiv,
|
|
|
[Erstellt_am] = @daErstellt_am,
|
|
|
[Mutiert_am] = @daMutiert_am,
|
|
|
[Mutierer] = @iMutierer
|
|
|
WHERE
|
|
|
[ToolTipNr] = @iToolTipNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Zielgruppe_Delete] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will delete an existing row from the table 'Zielgruppe'
|
|
|
-- using the Primary Key.
|
|
|
-- Gets: @iZielgruppeNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Zielgruppe_Delete]
|
|
|
@iZielgruppeNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- DELETE an existing row from the table.
|
|
|
DELETE FROM [dbo].[Zielgruppe]
|
|
|
WHERE
|
|
|
[ZielgruppeNr] = @iZielgruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Zielgruppe_Insert] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will insert 1 row in the table 'Zielgruppe'
|
|
|
-- Gets: @iZielgruppeNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Zielgruppe_Insert]
|
|
|
@iZielgruppeNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- INSERT a new row in the table.
|
|
|
INSERT [dbo].[Zielgruppe]
|
|
|
(
|
|
|
[ZielgruppeNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
)
|
|
|
VALUES
|
|
|
(
|
|
|
@iZielgruppeNr,
|
|
|
@sBezeichnung,
|
|
|
@sBeschreibung,
|
|
|
@baktiv,
|
|
|
@daerstellt_am,
|
|
|
@damutiert_am,
|
|
|
@imutierer
|
|
|
)
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Zielgruppe_SelectAll] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Zielgruppe'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Zielgruppe_SelectAll]
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT all rows from the table.
|
|
|
SELECT
|
|
|
[ZielgruppeNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Zielgruppe]
|
|
|
ORDER BY
|
|
|
[ZielgruppeNr] ASC
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Zielgruppe_SelectOne] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select an existing row from the table 'Zielgruppe'
|
|
|
-- based on the Primary Key.
|
|
|
-- Gets: @iZielgruppeNr int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Zielgruppe_SelectOne]
|
|
|
@iZielgruppeNr int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- SELECT an existing row from the table.
|
|
|
SELECT
|
|
|
[ZielgruppeNr],
|
|
|
[Bezeichnung],
|
|
|
[Beschreibung],
|
|
|
[aktiv],
|
|
|
[erstellt_am],
|
|
|
[mutiert_am],
|
|
|
[mutierer]
|
|
|
FROM [dbo].[Zielgruppe]
|
|
|
WHERE
|
|
|
[ZielgruppeNr] = @iZielgruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[pr_Zielgruppe_Update] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will update an existing row in the table 'Zielgruppe'
|
|
|
-- Gets: @iZielgruppeNr int
|
|
|
-- Gets: @sBezeichnung varchar(255)
|
|
|
-- Gets: @sBeschreibung varchar(255)
|
|
|
-- Gets: @baktiv bit
|
|
|
-- Gets: @daerstellt_am datetime
|
|
|
-- Gets: @damutiert_am datetime
|
|
|
-- Gets: @imutierer int
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
CREATE PROCEDURE [dbo].[pr_Zielgruppe_Update]
|
|
|
@iZielgruppeNr int,
|
|
|
@sBezeichnung varchar(255),
|
|
|
@sBeschreibung varchar(255),
|
|
|
@baktiv bit,
|
|
|
@daerstellt_am datetime,
|
|
|
@damutiert_am datetime,
|
|
|
@imutierer int,
|
|
|
@iErrorCode int OUTPUT
|
|
|
AS
|
|
|
SET NOCOUNT ON
|
|
|
-- UPDATE an existing row in the table.
|
|
|
UPDATE [dbo].[Zielgruppe]
|
|
|
SET
|
|
|
[Bezeichnung] = @sBezeichnung,
|
|
|
[Beschreibung] = @sBeschreibung,
|
|
|
[aktiv] = @baktiv,
|
|
|
[erstellt_am] = @daerstellt_am,
|
|
|
[mutiert_am] = @damutiert_am,
|
|
|
[mutierer] = @imutierer
|
|
|
WHERE
|
|
|
[ZielgruppeNr] = @iZielgruppeNr
|
|
|
-- Get the Error Code for the statement just executed.
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp__pendenzenliste] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp__pendenzenliste]
|
|
|
@Mitarbeiternr int,
|
|
|
@pendenzstatusnr int
|
|
|
|
|
|
|
|
|
AS
|
|
|
-- Pendenzart 1 = Offen
|
|
|
if @pendenzstatusnr<>-1 begin
|
|
|
SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.themanr, dbo.Pendenz.Verantwortlich, dbo.Pendenz.PendenzStatusNr,
|
|
|
dbo.Pendenz.Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am, dbo.Pendenz.Mutiert_am,
|
|
|
dbo.Pendenz.Mutierer, dbo.Pendenz.MandantNr, dbo.Pendenzstatus.Bezeichnung AS Pendenzstatus,
|
|
|
ISNULL(dbo.thema.titel, '') AS Thema
|
|
|
FROM dbo.Pendenz INNER JOIN
|
|
|
dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr LEFT OUTER JOIN
|
|
|
dbo.Thema ON dbo.Pendenz.themanr = dbo.thema.themannr
|
|
|
where dbo.pendenz.mutierer=@mitarbeiternr and dbo.pendenz.pendenzstatusnr=@pendenzstatusnr
|
|
|
order by Termin asc
|
|
|
end
|
|
|
--
|
|
|
if @pendenzstatusnr=-1 begin
|
|
|
SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.themanr, dbo.Pendenz.Verantwortlich, dbo.Pendenz.PendenzStatusNr,
|
|
|
dbo.Pendenz.Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am, dbo.Pendenz.Mutiert_am,
|
|
|
dbo.Pendenz.Mutierer, dbo.Pendenz.MandantNr, dbo.Pendenzstatus.Bezeichnung AS Pendenzstatus,
|
|
|
ISNULL(dbo.thema.titel, '') AS Thema
|
|
|
FROM dbo.Pendenz INNER JOIN
|
|
|
dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr LEFT OUTER JOIN
|
|
|
dbo.thema ON dbo.Pendenz.themanr = dbo.thema.ThemanNr
|
|
|
where dbo.pendenz.mutierer=@mitarbeiternr
|
|
|
order by Termin asc
|
|
|
end
|
|
|
|
|
|
-- Pendenzart -2 = Alle im Status Offen(1) und In Bearbeitung (2)
|
|
|
--if @pendenzstatusnr=-2 begin
|
|
|
-- SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.VertragselementNr, dbo.Pendenz.Verantwortlich, dbo.Pendenz.PendenzStatusNr,
|
|
|
-- dbo.Pendenz.Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am, dbo.Pendenz.Mutiert_am,
|
|
|
-- dbo.Pendenz.Mutierer, dbo.Pendenz.MandantNr, dbo.Pendenz.SecurityLevelNr, dbo.Pendenzstatus.Bezeichnung AS Pendenzstatus,
|
|
|
-- ISNULL(dbo.Vertragselement.Bezeichnung, '') AS Vertragselement
|
|
|
-- FROM dbo.Pendenz INNER JOIN
|
|
|
-- dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr LEFT OUTER JOIN
|
|
|
-- dbo.Vertragselement ON dbo.Pendenz.VertragselementNr = dbo.Vertragselement.Vertragselementnr
|
|
|
-- where (dbo.pendenz.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr) or dbo.pendenz.mutierer=@mitarbeiternr)
|
|
|
-- and dbo.pendenz.pendenzstatusnr<3
|
|
|
-- order by Termin asc
|
|
|
--end
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_Auswertung_Get_Auswertungen] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
Create proc [dbo].[sp_Auswertung_Get_Auswertungen]
|
|
|
@mitarbeiternr int
|
|
|
as
|
|
|
CREATE TABLE #tmpd(
|
|
|
[ID] [int] ,
|
|
|
[bezeichnung] [varchar] (255) null,
|
|
|
[parentid] [int] null,
|
|
|
[Auswertungnr] [int],
|
|
|
[beschreibung] [varchar] (1024) null
|
|
|
) ON [PRIMARY]
|
|
|
|
|
|
declare @id int
|
|
|
declare @gnr int
|
|
|
declare @anr int
|
|
|
declare @bez varchar(255)
|
|
|
declare @pid int
|
|
|
declare @gnr1 int
|
|
|
declare @gbez varchar(255)
|
|
|
declare @cnt int
|
|
|
declare @besch varchar(1024)
|
|
|
set @id=1000
|
|
|
declare xc cursor for
|
|
|
SELECT DISTINCT dbo.auswertunggruppeauswertung.auswertunggruppenr as auswertunggruppenr, dbo.auswertung.auswertungnr,
|
|
|
dbo.auswertung.bezeichnung as auswertung, dbo.auswertung.beschreibung
|
|
|
FROM dbo.AuswertungGruppe INNER JOIN
|
|
|
dbo.funktionsgruppe_auswertungGruppe ON dbo.AuswertungGruppe.AuswertungGruppeNr = dbo.funktionsgruppe_auswertungGruppe.AuswertungGruppeNr INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.funktionsgruppe_auswertungGruppe.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
|
dbo.mitarbeiter_funktionsgruppe ON dbo.funktionsgruppe.funktionsgruppenr = dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr INNER JOIN
|
|
|
dbo.AuswertungGruppeAuswertung ON dbo.AuswertungGruppe.AuswertungGruppeNr = dbo.AuswertungGruppeAuswertung.AuswertungGruppeNr INNER JOIN
|
|
|
dbo.Auswertung ON dbo.AuswertungGruppeAuswertung.AuswertungNr = dbo.Auswertung.AuswertungNr
|
|
|
WHERE (dbo.AuswertungGruppe.Aktiv = 1) AND (dbo.funktionsgruppe_auswertungGruppe.Aktiv = 1) AND (dbo.funktionsgruppe.aktiv = 1) AND
|
|
|
(dbo.mitarbeiter_funktionsgruppe.aktiv = 1) AND (dbo.AuswertungGruppeAuswertung.Aktiv = 1) AND (dbo.Auswertung.Aktiv = 1) AND
|
|
|
(dbo.mitarbeiter_funktionsgruppe.mitarbeiternr = @mitarbeiternr)
|
|
|
open xc
|
|
|
fetch next from xc into @gnr, @anr, @bez, @besch
|
|
|
while @@fetch_status=0 begin
|
|
|
set @id=@id+1
|
|
|
insert #tmpd(id, bezeichnung, parentid, auswertungnr, beschreibung) values (@id, @bez, @gnr, @anr, @besch)
|
|
|
|
|
|
set @pid=@gnr
|
|
|
while @pid>0 begin
|
|
|
select @gnr1=auswertunggruppenr, @gbez=bezeichnung, @pid=parentid from auswertunggruppe where auswertunggruppenr=@gnr
|
|
|
select @cnt=count(*) from #tmpd where id=@gnr1
|
|
|
if @cnt=0 insert #tmpd(id, bezeichnung, parentid, auswertungnr, beschreibung) values (@gnr1,@gbez,@pid,0,'')
|
|
|
set @gnr=@pid
|
|
|
end
|
|
|
fetch next from xc into @gnr, @anr, @bez, @besch
|
|
|
end
|
|
|
close xc
|
|
|
deallocate xc
|
|
|
insert #tmpd (id, bezeichnung, parentid, auswertungnr, beschreibung) values (0, 'root',null,null,null)
|
|
|
select * from #tmpd order by bezeichnung
|
|
|
drop table #tmpd
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_aktive_funktionen] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
Create PROCEDURE [dbo].[sp_get_aktive_funktionen]
|
|
|
|
|
|
AS
|
|
|
BEGIN
|
|
|
select Funktionnr as ID, Bezeichnung from Funktion where Aktiv=1 order by Bezeichnung
|
|
|
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_aktive_personen] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_aktive_personen]
|
|
|
|
|
|
AS
|
|
|
BEGIN
|
|
|
select personnr as ID, Name+' '+vorname as Name from Person where Aktiv=1 order by Name, Vorname
|
|
|
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_dbkey] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_dbkey]
|
|
|
@tablename varchar(255),
|
|
|
@dbkey int output,
|
|
|
@iErrorcode int output
|
|
|
AS
|
|
|
BEGIN
|
|
|
declare @zwkey int
|
|
|
select @zwkey = key_wert from key_tabelle where beschreibung = @tablename
|
|
|
set @zwkey = @zwkey + 1
|
|
|
update key_tabelle set key_wert = @zwkey where beschreibung=@tablename
|
|
|
select @dbkey = @zwkey
|
|
|
select @iErrorCode=@@Error
|
|
|
END
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_dokumente] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_dokumente]
|
|
|
---------------------------------------------------------------------------------
|
|
|
-- Stored procedure that will select all rows from the table 'Kuendigungsfrist'
|
|
|
-- Returns: @iErrorCode int
|
|
|
---------------------------------------------------------------------------------
|
|
|
@keyvalue int,
|
|
|
@doktype int,
|
|
|
@mitarbeiternr int
|
|
|
AS
|
|
|
SELECT 0 as DokIcon, dbo.Dokument.DokumentNr, dbo.Dokument.KeyValue, dbo.Dokumenttyp.Bezeichnung as Dokumenttyp, dbo.Dokument.Bezeichnung AS Bezeichnung, dbo.Dokument.Beschreibung,
|
|
|
dbo.Dokument.Filename, dbo.Dokument.OriginalFilename_incl_Path, dbo.Dokument.Version, dbo.Dokument.VersionsNr, dbo.Dokument.Versionsdatum,
|
|
|
dbo.Dokument.Erstellt_am, dbo.Dokument.Mutiert_am, dbo.Dokument.Mutierer, dbo.Dokument.Aktiv, dbo.Dokument.DocImage, 0 as DokIdon, SpeichertypNr
|
|
|
FROM dbo.Dokument INNER JOIN
|
|
|
dbo.Dokumenttyp ON dbo.Dokument.DokumenttypNr = dbo.Dokumenttyp.Dokumenttypnr
|
|
|
where Keyvalue = @keyvalue and doktype=@doktype
|
|
|
order by dbo.dokument.erstellt_am desc
|
|
|
|
|
|
|
|
|
|
|
|
RETURN
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_entwicklungseintraege] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_entwicklungseintraege]
|
|
|
@themanr int,
|
|
|
@order int=0
|
|
|
AS
|
|
|
BEGIN
|
|
|
|
|
|
select themaentwicklungnr,bezeichnung,aktiv,mutiert_am,dbo.get_mutierer(0) as Mutierer into #tmp1 from themaentwicklung where ThemaEntwicklungNr=0
|
|
|
alter table #tmp1 add pk [int] IDENTITY(1,1) NOT NULL
|
|
|
|
|
|
declare @nr int
|
|
|
declare @bez varchar(255)
|
|
|
declare @aktiv bit
|
|
|
declare @mutiert_am datetime
|
|
|
declare @ma varchar(255)
|
|
|
declare @mutierer int
|
|
|
declare xc cursor for
|
|
|
select themaentwicklungnr,bezeichnung,aktiv,mutiert_am,dbo.get_mutierer(mutierer), mutierer from themaentwicklung where themanr=@themanr order by erstellt_am desc
|
|
|
open xc
|
|
|
fetch next from xc into @nr,@bez,@aktiv,@mutiert_am,@ma,@mutierer
|
|
|
while @@FETCH_STATUS=0 begin
|
|
|
insert #tmp1 (themaentwicklungnr, bezeichnung,aktiv,mutiert_am, mutierer) values(@nr,@bez,@aktiv,@mutiert_am,@ma)
|
|
|
|
|
|
declare xy cursor for select journaldatum,dbo.get_mutierer(@mutierer) from themaentwicklungjournal where themaentwicklungnr=@nr order by erstellt_am desc
|
|
|
open xy
|
|
|
fetch next from xy into @mutiert_am,@ma
|
|
|
while @@FETCH_STATUS=0 begin
|
|
|
insert #tmp1 (themaentwicklungnr, bezeichnung,aktiv,mutiert_am, mutierer) values(@nr,@bez,@aktiv,@mutiert_am,@ma)
|
|
|
fetch next from xy into @mutiert_am,@ma
|
|
|
end
|
|
|
close xy
|
|
|
deallocate xy
|
|
|
fetch next from xc into @nr,@bez,@aktiv,@mutiert_am,@ma,@mutierer
|
|
|
end
|
|
|
close xc
|
|
|
deallocate xc
|
|
|
if @order=1 begin
|
|
|
select * from #tmp1 order by pk desc
|
|
|
end
|
|
|
if @order=2 begin
|
|
|
select * from #tmp1 order by pk
|
|
|
end
|
|
|
if @order = 0 begin
|
|
|
select * from #tmp1 order by pk
|
|
|
end
|
|
|
|
|
|
drop table #tmp1
|
|
|
|
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_journal] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_journal]
|
|
|
@themanr int
|
|
|
AS
|
|
|
BEGIN
|
|
|
SELECT * FROM journal WHERE themanr=@themanr ORDER BY erstellt_am desc
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_kategorien] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_kategorien]
|
|
|
as
|
|
|
begin
|
|
|
select KategorieNr as id, Parentid, bezeichnung, 1 as ImageIndex into #tmp1 from Kategorie where aktiv=1 or KategorieNr in (select KategorieNr from Thema where aktiv=1)
|
|
|
insert #tmp1 (id,bezeichnung,Imageindex) values (0,'Root',1)
|
|
|
select * from #tmp1
|
|
|
drop table #tmp1
|
|
|
end
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_Kommunikationauspraegung] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_Kommunikationauspraegung]
|
|
|
@kommunikationnr int
|
|
|
AS
|
|
|
BEGIN
|
|
|
select * from KommunkationAuspraegung where aktiv=1 and KommunikationNr=@KommunikationNr order by erstellt_am
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_Kommunikationseintraege] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_Kommunikationseintraege]
|
|
|
@themanr int
|
|
|
AS
|
|
|
BEGIN
|
|
|
select * from Kommunikation where aktiv=1 and ThemaNr=@themanr order by erstellt_am desc
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_nebenkategorie] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_nebenkategorie] @themanr INT
|
|
|
AS
|
|
|
BEGIN
|
|
|
SELECT dbo.Nebenkategorie.KategorieNr,dbo.Kategorie.Bezeichnung
|
|
|
FROM dbo.Kategorie
|
|
|
INNER JOIN dbo.Nebenkategorie ON dbo.Kategorie.KategorieNr = dbo.Nebenkategorie.KategorieNr
|
|
|
WHERE Nebenkategorie.Themanr = @themanr
|
|
|
AND Nebenkategorie.aktiv = 1
|
|
|
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_stammdaten] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
|
-- Author: Stefan Hutter
|
|
|
-- Create date: 14.4.2009
|
|
|
-- Description: Liest die Stammdatentabellen
|
|
|
-- Changelog:
|
|
|
-- 15.4.09 Anpassung, dass nur die aktiven Datenelemente ausgelesen werden
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_stammdaten]
|
|
|
@mitarbeiternr int,
|
|
|
@tabelle varchar(255),
|
|
|
@orderby varchar(255)
|
|
|
as
|
|
|
begin
|
|
|
declare @xsql varchar(255)
|
|
|
if upper(@tabelle)='KOSTENART' begin
|
|
|
select kostenartnr, bezeichnung + ' - ' + beschreibung as Bezeichnung from kostenart where aktiv=1 order by bezeichnung
|
|
|
return
|
|
|
end
|
|
|
|
|
|
if upper(@tabelle)='KONTAKTTYP_GREMIUM' begin
|
|
|
select kontakttypnr, bezeichnung, applikationsbereichnr from kontakttyp where applikationsbereichnr=3 and aktiv=1 order by bezeichnung
|
|
|
return
|
|
|
end
|
|
|
|
|
|
if upper(@tabelle)='RELEASEART' begin
|
|
|
select Releaseartnr, bezeichnung as Bezeichnung from Releaseart where aktiv=1 order by bezeichnung
|
|
|
return
|
|
|
end
|
|
|
|
|
|
--if upper(@tabelle)='PERSON' begin
|
|
|
-- select personnr, Name +' '+Vorname as Bezeichnung from Person where Vertragspartnernr=1 and Aktiv=1 order by Name, Vorname
|
|
|
-- return
|
|
|
--end
|
|
|
--if upper(@tabelle)='PERSON1' begin
|
|
|
-- select personnr, Name +' '+Vorname as Bezeichnung from Person where Vertragspartnernr=1 and Aktiv=1 order by Name, Vorname
|
|
|
-- return
|
|
|
--end
|
|
|
--if upper(@tabelle)='PERSON2' begin
|
|
|
-- select personnr, Name +' '+Vorname as Bezeichnung from Person where Vertragspartnernr=1 and Aktiv=1 order by Name, Vorname
|
|
|
-- return
|
|
|
--end
|
|
|
|
|
|
set @xsql='Select * from ' + @tabelle + ' where aktiv=1 order by ' + @orderby
|
|
|
exec(@xsql)
|
|
|
end
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_sysadmin_hierarchie_data] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE proc [dbo].[sp_get_sysadmin_hierarchie_data]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Root int,
|
|
|
@isprache int,
|
|
|
@imandant int
|
|
|
AS
|
|
|
BEGIN
|
|
|
SET NOCOUNT ON
|
|
|
DECLARE @DokID int, @Dokname varchar(30), @nr int, @pa int, @sort int, @i1 int, @i2 int
|
|
|
SET @DokName = (SELECT Bezeichnung FROM dbo.sysadminfunktion WHERE sysadminfnktnr = @Root and sprache=@isprache and mandantnr=@imandant)
|
|
|
set @nr = (SELECT sysadminfnktnr FROM dbo.sysadminfunktion WHERE sysadminfnktnr = @Root and sprache=@isprache and mandantnr=@imandant)
|
|
|
set @pa = (SELECT parentid FROM dbo.sysadminfunktion WHERE sysadminfnktnr = @Root and sprache=@isprache and mandantnr=@imandant)
|
|
|
set @sort = (SELECT isnull(sort,0) FROM dbo.sysadminfunktion WHERE sysadminfnktnr = @Root and sprache=@isprache and mandantnr=@imandant)
|
|
|
set @i1 = (SELECT imageindex FROM dbo.sysadminfunktion WHERE sysadminfnktnr = @Root and sprache=@isprache and mandantnr=@imandant)
|
|
|
set @i2 = (SELECT imageindexopen FROM dbo.sysadminfunktion WHERE sysadminfnktnr = @Root and sprache=@isprache and mandantnr=@imandant)
|
|
|
|
|
|
PRINT str(@nr) + ' ' + @Dokname
|
|
|
|
|
|
insert into #tmph (sysadminfnktnr, Bezeichnung, imageindex,imageindexopen, parentid,sort) values(@nr,@dokname,@i1,@i2,@pa,@sort)
|
|
|
|
|
|
SET @DokID = (SELECT (parentid) FROM dbo.sysadminfunktion WHERE sysadminfnktnr=@nr)
|
|
|
WHILE (@dokid IS NOT NULL) and (@dokid<>0)
|
|
|
BEGIN
|
|
|
EXEC sp_get_sysadmin_hierarchie_data @DOkid, @isprache, @imandant
|
|
|
SET @DokID = (SELECT (parentid) FROM dbo.sysadminfunktion WHERE sysadminfnktnr=@nr AND parentid > @dokID)
|
|
|
END
|
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_sysadmin_tree] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE proc [dbo].[sp_get_sysadmin_tree]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------------------------------------
|
|
|
-- Liest die Dokumentart-Hierarchie, Knoten Root in der entsprechenden Sprache, für den entsprechenden Mandanten
|
|
|
--
|
|
|
-- Autor: Stefan Hutter
|
|
|
--------------------------------------------------------------
|
|
|
@imitarbeiternr int,
|
|
|
@iSprache int,
|
|
|
@iMandant int,
|
|
|
@iRoot int,
|
|
|
@iErrorcode int output
|
|
|
AS
|
|
|
CREATE TABLE #tmph(
|
|
|
[sysadminfnktnr] [int] NULL ,
|
|
|
[bezeichnung] [varchar] (255) null,
|
|
|
[imageindex] [int] NULL ,
|
|
|
[imageindexopen] [int] NULL,
|
|
|
[parentid] [int] null,
|
|
|
[sort] [int] null
|
|
|
) ON [PRIMARY]
|
|
|
declare @sfnkt int
|
|
|
declare xcursor cursor for
|
|
|
SELECT dbo.rolle_sysadminfunktion.sysadminfnktnr
|
|
|
FROM dbo.mitarbeiter_funktionsgruppe INNER JOIN
|
|
|
dbo.funktionsgruppe_rolle ON dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr = dbo.funktionsgruppe_rolle.funktionsgruppenr INNER JOIN
|
|
|
dbo.rolle_sysadminfunktion ON dbo.funktionsgruppe_rolle.rollenr = dbo.rolle_sysadminfunktion.rollenr INNER JOIN
|
|
|
dbo.funktionsgruppe ON dbo.mitarbeiter_funktionsgruppe.funktionsgruppenr = dbo.funktionsgruppe.funktionsgruppenr
|
|
|
WHERE (dbo.rolle_sysadminfunktion.aktiv = 1) AND (dbo.funktionsgruppe_rolle.aktiv = 1) AND (dbo.mitarbeiter_funktionsgruppe.aktiv = 1) AND
|
|
|
(dbo.funktionsgruppe.aktiv = 1) AND (dbo.mitarbeiter_funktionsgruppe.mitarbeiternr = @imitarbeiternr)
|
|
|
/*
|
|
|
SELECT dbo.rolle_sysadminfunktion.sysadminfnktnr
|
|
|
FROM dbo.rolle INNER JOIN
|
|
|
dbo.mitarbeiterrolle ON dbo.rolle.rollenr = dbo.mitarbeiterrolle.rollenr INNER JOIN
|
|
|
dbo.rolle_sysadminfunktion ON dbo.rolle.rollenr = dbo.rolle_sysadminfunktion.rollenr
|
|
|
WHERE dbo.mitarbeiterrolle.mitarbeiternr = @imitarbeiternr and
|
|
|
rolle_sysadminfunktion.aktiv=1 and
|
|
|
dbo.rolle.aktiv=1 and
|
|
|
dbo.mitarbeiterrolle.aktiv=1
|
|
|
*/
|
|
|
|
|
|
open xcursor
|
|
|
FETCH NEXT FROM xcursor into @sfnkt
|
|
|
WHILE @@FETCH_STATUS = 0 BEGIN
|
|
|
execute sp_get_sysadmin_hierarchie_data @sfnkt, @isprache, @imandant
|
|
|
FETCH NEXT FROM xcursor into @sfnkt
|
|
|
end
|
|
|
close xcursor
|
|
|
deallocate xcursor
|
|
|
|
|
|
delete #tmph where parentid is null
|
|
|
update #tmph set parentid=0, imageindex=2, imageindexopen=2 where sysadminfnktnr=@iroot
|
|
|
select distinct * from #tmph order by sort
|
|
|
drop table #tmph
|
|
|
select @iErrorcode=@@error
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_thema_personen] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_thema_personen]
|
|
|
@themanr int
|
|
|
as
|
|
|
BEGIN
|
|
|
SELECT dbo.Person.Firma, dbo.Person.Name, dbo.Person.Vorname, dbo.Person.Telefon, dbo.Person.EMail, dbo.Person.Internet, dbo.ThemaPerson.Bemerkung,
|
|
|
dbo.Funktion.Bezeichnung, dbo.ThemaPerson.ThemaPersonNr, dbo.Person.PersonNr
|
|
|
FROM dbo.ThemaPerson INNER JOIN
|
|
|
dbo.Person ON dbo.ThemaPerson.PersonNr = dbo.Person.PersonNr INNER JOIN
|
|
|
dbo.Funktion ON dbo.ThemaPerson.FunktionNr = dbo.Funktion.FunktionNr
|
|
|
where ThemaPerson.aktiv=1 and ThemaPerson.ThemaNr=@themanr
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_themen] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE Procedure [dbo].[sp_get_themen]
|
|
|
@Kategorienr int
|
|
|
AS
|
|
|
BEGIN
|
|
|
SET NOCOUNT ON;
|
|
|
--select * from thema where aktiv=1 and kategorienr=@kategorienr
|
|
|
|
|
|
SELECT dbo.Thema.ThemanNr, dbo.Thema.Titel, dbo.Thema.KategorieNr, dbo.Thema.Beschreibung, dbo.Thema.Suchbegriffe, dbo.Thema.Gueltig_ab,
|
|
|
dbo.Thema.Gueltig_bis, dbo.Thema.aktiv, dbo.Thema.erstellt_am, dbo.Thema.mutiert_am, dbo.Thema.mutierer, dbo.Kategorie.Bezeichnung AS Kategorie
|
|
|
INTO #tmp1
|
|
|
|
|
|
FROM dbo.Thema
|
|
|
INNER JOIN dbo.Kategorie ON dbo.Thema.KategorieNr = dbo.Kategorie.KategorieNr
|
|
|
WHERE ( dbo.Thema.aktiv = 1 )
|
|
|
AND dbo.thema.kategorienr = @kategorienr
|
|
|
|
|
|
INSERT #tmp1
|
|
|
SELECT dbo.Thema.ThemanNr, dbo.Thema.Titel, dbo.Thema.KategorieNr, dbo.Thema.Beschreibung, dbo.Thema.Suchbegriffe, dbo.Thema.Gueltig_ab, dbo.Thema.Gueltig_bis,
|
|
|
dbo.Thema.aktiv, dbo.Thema.erstellt_am, dbo.Thema.mutiert_am, dbo.Thema.mutierer, dbo.Kategorie.Bezeichnung AS Kategorie
|
|
|
FROM dbo.Nebenkategorie INNER JOIN
|
|
|
dbo.Kategorie ON dbo.Nebenkategorie.KategorieNr = dbo.Kategorie.KategorieNr INNER JOIN
|
|
|
dbo.Thema ON dbo.Nebenkategorie.Themanr = dbo.Thema.ThemanNr
|
|
|
WHERE (dbo.Thema.aktiv = 1) AND (dbo.Nebenkategorie.Aktiv = 1) AND (dbo.Nebenkategorie.KategorieNr = @kategorienr)
|
|
|
SELECT DISTINCT * FROM #tmp1
|
|
|
DROP TABLE #tmp1
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_themen_nach_freitext] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_themen_nach_freitext] @text VARCHAR(255)
|
|
|
AS
|
|
|
BEGIN
|
|
|
SET NOCOUNT ON;
|
|
|
SELECT ThemanNr, Titel, KategorieNr
|
|
|
INTO #tmp1
|
|
|
FROM dbo.Thema
|
|
|
WHERE ( ThemanNr IN ( SELECT Themanr
|
|
|
FROM dbo.FulltextData
|
|
|
WHERE ( Fulltext LIKE '%' + @text + '%' ) ) )
|
|
|
|
|
|
INSERT #tmp1 (themaNnr, titel, kategorienr ) SELECT themannr, titel, kategorienr FROM dbo.Thema
|
|
|
WHERE titel LIKE '%' + @text + '%' OR Beschreibung LIKE '%' + @text + '%' OR Suchbegriffe LIKE '%' + @text + '%'
|
|
|
|
|
|
SELECT DISTINCT * FROM #tmp1
|
|
|
DROP TABLE #tmp1
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_Zielgruppen] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_get_Zielgruppen]
|
|
|
@kommunikationAuspraegungnr int
|
|
|
AS
|
|
|
BEGIN
|
|
|
SET NOCOUNT ON;
|
|
|
select * from KommunikationAuspraegung_Zielgruppe where aktiv=1 and kommunikationauspraegungnr=@kommunikationAuspraegungnr
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_insert_journal] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_insert_journal]
|
|
|
@themanr INT,
|
|
|
@mitarbeiternr INT,
|
|
|
@beschreibung VARCHAR(1024)
|
|
|
|
|
|
AS
|
|
|
BEGIN
|
|
|
DECLARE @ma VARCHAR(255)
|
|
|
SELECT @ma = tgnummer+': ' + name +' '+vorname FROM dbo.mitarbeiter WHERE mitarbeiternr=@mitarbeiternr
|
|
|
INSERT INTO .[dbo].[Journal]
|
|
|
(themanr, [Beschreibung]
|
|
|
,[Mutierer]
|
|
|
,[Erstellt_am])
|
|
|
VALUES
|
|
|
(@themanr, @beschreibung, @ma, GETDATE())
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_pendenzenliste] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
Create PROCEDURE [dbo].[sp_pendenzenliste]
|
|
|
@Mitarbeiternr int,
|
|
|
@pendenzstatusnr int
|
|
|
|
|
|
|
|
|
AS
|
|
|
-- Pendenzart 1 = Offen
|
|
|
if @pendenzstatusnr<>-1 begin
|
|
|
SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.themanr, dbo.Pendenz.Verantwortlich, dbo.Pendenz.PendenzStatusNr,
|
|
|
dbo.Pendenz.Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am, dbo.Pendenz.Mutiert_am,
|
|
|
dbo.Pendenz.Mutierer, dbo.Pendenz.MandantNr, dbo.Pendenzstatus.Bezeichnung AS Pendenzstatus,
|
|
|
ISNULL(dbo.thema.titel, '') AS Thema
|
|
|
FROM dbo.Pendenz INNER JOIN
|
|
|
dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr LEFT OUTER JOIN
|
|
|
dbo.Thema ON dbo.Pendenz.themanr = dbo.thema.themannr
|
|
|
where dbo.pendenz.mutierer=@mitarbeiternr and dbo.pendenz.pendenzstatusnr=@pendenzstatusnr
|
|
|
order by Termin asc
|
|
|
end
|
|
|
--
|
|
|
if @pendenzstatusnr=-1 begin
|
|
|
SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.themanr, dbo.Pendenz.Verantwortlich, dbo.Pendenz.PendenzStatusNr,
|
|
|
dbo.Pendenz.Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am, dbo.Pendenz.Mutiert_am,
|
|
|
dbo.Pendenz.Mutierer, dbo.Pendenz.MandantNr, dbo.Pendenzstatus.Bezeichnung AS Pendenzstatus,
|
|
|
ISNULL(dbo.thema.titel, '') AS Thema
|
|
|
FROM dbo.Pendenz INNER JOIN
|
|
|
dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr LEFT OUTER JOIN
|
|
|
dbo.thema ON dbo.Pendenz.themanr = dbo.thema.ThemanNr
|
|
|
where dbo.pendenz.mutierer=@mitarbeiternr
|
|
|
order by Termin asc
|
|
|
end
|
|
|
|
|
|
-- Pendenzart -2 = Alle im Status Offen(1) und In Bearbeitung (2)
|
|
|
--if @pendenzstatusnr=-2 begin
|
|
|
-- SELECT dbo.Pendenz.PendenzNr, dbo.Pendenz.VertragselementNr, dbo.Pendenz.Verantwortlich, dbo.Pendenz.PendenzStatusNr,
|
|
|
-- dbo.Pendenz.Bezeichnung, dbo.Pendenz.Beschreibung, dbo.Pendenz.Termin, dbo.Pendenz.Aktiv, dbo.Pendenz.Erstellt_am, dbo.Pendenz.Mutiert_am,
|
|
|
-- dbo.Pendenz.Mutierer, dbo.Pendenz.MandantNr, dbo.Pendenz.SecurityLevelNr, dbo.Pendenzstatus.Bezeichnung AS Pendenzstatus,
|
|
|
-- ISNULL(dbo.Vertragselement.Bezeichnung, '') AS Vertragselement
|
|
|
-- FROM dbo.Pendenz INNER JOIN
|
|
|
-- dbo.Pendenzstatus ON dbo.Pendenz.PendenzStatusNr = dbo.Pendenzstatus.PendenzStatusNr LEFT OUTER JOIN
|
|
|
-- dbo.Vertragselement ON dbo.Pendenz.VertragselementNr = dbo.Vertragselement.Vertragselementnr
|
|
|
-- where (dbo.pendenz.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr) or dbo.pendenz.mutierer=@mitarbeiternr)
|
|
|
-- and dbo.pendenz.pendenzstatusnr<3
|
|
|
-- order by Termin asc
|
|
|
--end
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_rpt_get_auswertungparameter] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
create PROCEDURE [dbo].[sp_rpt_get_auswertungparameter]
|
|
|
@auswertungnr int
|
|
|
as
|
|
|
BEGIN
|
|
|
SET NOCOUNT ON;
|
|
|
SELECT dbo.Auswertungsparameter.Auswertungparameternr, dbo.Auswertungsparameter.Bezeichnung, dbo.Auswertungsparameter.Operator,
|
|
|
dbo.Auswertungsparameter.Feldbezug, dbo.Auswertungsparameter.Wert, dbo.Auswertungsparameter.ParamName, dbo.AuswertungAuswertungParameter.DBfeldname,
|
|
|
dbo.Auswertungsparameter.ParamType, dbo.AuswertungAuswertungParameter.Auswertungnr, dbo.AuswertungAuswertungParameter.Reihenfolge
|
|
|
FROM dbo.AuswertungAuswertungParameter INNER JOIN
|
|
|
dbo.Auswertungsparameter ON dbo.AuswertungAuswertungParameter.Auswertungparameternr = dbo.Auswertungsparameter.Auswertungparameternr
|
|
|
WHERE (dbo.Auswertungsparameter.Aktiv = 1) AND (dbo.AuswertungAuswertungParameter.Aktiv = 1) AND (dbo.AuswertungAuswertungParameter.Auswertungnr = @auswertungnr)
|
|
|
ORDER BY dbo.AuswertungAuswertungParameter.Reihenfolge
|
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_search_split] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
create proc [dbo].[sp_search_split] (
|
|
|
@sInputList varchar(8000) -- List of delimited items
|
|
|
, @Delimiter char(1) = ',' -- delimiter that separates items
|
|
|
)
|
|
|
AS BEGIN
|
|
|
SET NOCOUNT ON
|
|
|
DECLARE @Item Varchar(8000)
|
|
|
WHILE CHARINDEX(@Delimiter,@sInputList,0) <> 0
|
|
|
BEGIN
|
|
|
SELECT
|
|
|
@Item=RTRIM(LTRIM(SUBSTRING(@sInputList,1,CHARINDEX(@Delimiter,@sInputList,0)-1))),
|
|
|
@sInputList=RTRIM(LTRIM(SUBSTRING(@sInputList,CHARINDEX(@Delimiter,@sInputList,0)+1,LEN(@sInputList))))
|
|
|
IF LEN(@Item) > 0
|
|
|
INSERT INTO #tmpdeli SELECT @Item
|
|
|
END
|
|
|
IF LEN(@sInputList) > 0 INSERT INTO #tmpdeli SELECT @sInputList -- Put the last item in
|
|
|
RETURN
|
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_set_kommunikationauspraegung_zielgruppe] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_set_kommunikationauspraegung_zielgruppe]
|
|
|
@kommunikationauspraegungnr int,
|
|
|
@zielgruppe varchar(255),
|
|
|
@checked int,
|
|
|
@mutierer int
|
|
|
AS
|
|
|
BEGIN
|
|
|
declare @znr int
|
|
|
declare @rc int
|
|
|
declare @dbkey int
|
|
|
declare @ierrorcode int
|
|
|
|
|
|
select @znr=zielgruppenr from Zielgruppe where Bezeichnung=@zielgruppe
|
|
|
|
|
|
select @rc=COUNT(*) from KommunikationAuspraegung_Zielgruppe where Kommunikationauspraegungnr=@kommunikationauspraegungnr and Zielgruppenr=@znr
|
|
|
if @rc=0 and @checked=1 begin
|
|
|
execute sp_get_dbkey 'KommunikationAuspraegung_Zielgruppe', @dbkey output, @ierrorcode output
|
|
|
insert KommunikationAuspraegung_Zielgruppe([KommAuspraegungZielgruppeNr]
|
|
|
,[Kommunikationauspraegungnr]
|
|
|
,[Zielgruppenr]
|
|
|
,[aktiv]
|
|
|
,[erstellt_am]
|
|
|
,[mutiert_am]
|
|
|
,[mutierer])
|
|
|
VALUES
|
|
|
(@dbkey,@kommunikationauspraegungnr,@znr,1,GETDATE(),GETDATE(),@mutierer)
|
|
|
end else begin
|
|
|
if @checked=0 begin
|
|
|
delete KommunikationAuspraegung_Zielgruppe where kommunikationauspraegungnr=@kommunikationauspraegungnr and Zielgruppenr=@znr
|
|
|
end
|
|
|
end
|
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_sysobjects_select] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_sysobjects_select] AS
|
|
|
select * from sysobjects where xtype='U' order by name
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_tooltips] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[sp_tooltips]
|
|
|
@fnkt int,
|
|
|
@formname varchar(50),
|
|
|
@controlname varchar(50),
|
|
|
@tooltip varchar(1024),
|
|
|
@mitarbeiternr int,
|
|
|
@outToolTipNr int output,
|
|
|
@outFormName varchar(50) output,
|
|
|
@outControlname varchar(50) output,
|
|
|
@outToolTip varchar(1024) output
|
|
|
AS
|
|
|
BEGIN
|
|
|
|
|
|
if @fnkt=1 begin
|
|
|
select @outtooltipnr=isnull(tooltipnr,0), @outformname=isnull(formularname,''), @outcontrolname=isnull(controlname,''), @outtooltip=isnull(tooltip,'')
|
|
|
from dbo.tooltip
|
|
|
where formularname=@formname and controlname=@controlname and aktiv=1
|
|
|
end
|
|
|
if @fnkt=2 begin
|
|
|
declare @tnr int
|
|
|
declare @dbkey int
|
|
|
|
|
|
declare @ierrorcode int
|
|
|
select @tnr=isnull(tooltipnr,-1)
|
|
|
from dbo.tooltip
|
|
|
where formularname=@formname and controlname=@controlname and aktiv=1
|
|
|
if @@rowcount=0 set @tnr=-1
|
|
|
if @tnr=-1 begin
|
|
|
execute sp_get_dbkey 'tooltip', @dbkey output, @ierrorcode output
|
|
|
insert dbo.tooltip(tooltipnr, formularname, controlname, tooltip, aktiv, erstellt_am, mutiert_am, mutierer)
|
|
|
values(@dbkey,@formname,@controlname,@tooltip,1,getdate(),getdate(),@mitarbeiternr)
|
|
|
end else begin
|
|
|
update dbo.tooltip set tooltip=@tooltip, mutierer=@mitarbeiternr, mutiert_am=getdate() where tooltipnr=@tnr
|
|
|
end
|
|
|
end
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_update_freitext] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_update_freitext]
|
|
|
@keyvalue INT,
|
|
|
@text VARCHAR(4096),
|
|
|
@type INT,
|
|
|
@themanr int
|
|
|
AS
|
|
|
BEGIN
|
|
|
DECLARE @rc INT
|
|
|
SELECT @rc=COUNT(*) FROM dbo.fulltextdata WHERE type=@type AND keyvalue=@keyvalue
|
|
|
IF @rc<1 BEGIN
|
|
|
INSERT fulltextdata (themanr, keyvalue,type,FULLTEXT) VALUES (@themanr,@keyvalue,@type,@text)
|
|
|
END ELSE BEGIN
|
|
|
UPDATE fulltextdata SET FULLTEXT=@text WHERE keyvalue=@keyvalue AND type=@type AND themanr=@themanr
|
|
|
end
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_update_nebenkategorie] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS ON
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
|
GO
|
|
|
-- =============================================
|
|
|
-- Author: <Author,,Name>
|
|
|
-- Create date: <Create Date,,>
|
|
|
-- Description: <Description,,>
|
|
|
-- =============================================
|
|
|
CREATE PROCEDURE [dbo].[sp_update_nebenkategorie]
|
|
|
@themanr INT ,
|
|
|
@kategorienr INT ,
|
|
|
@aktiv INT ,
|
|
|
@mutierer INT
|
|
|
AS
|
|
|
BEGIN
|
|
|
DECLARE @rc INT
|
|
|
DECLARE @kat VARCHAR(255)
|
|
|
SELECT @rc = COUNT(*)
|
|
|
FROM nebenkategorie
|
|
|
WHERE themanr = @themanr
|
|
|
AND KategorieNr = @kategorienr
|
|
|
AND aktiv = 1
|
|
|
IF @rc = 0
|
|
|
BEGIN
|
|
|
INSERT nebenkategorie ( kategorienr, themanr, erstellt_am, mutiert_am, mutierer, aktiv )
|
|
|
VALUES ( @kategorienr, @themanr, GETDATE(), GETDATE(), @mutierer, @aktiv )
|
|
|
|
|
|
|
|
|
|
|
|
SELECT @kat = 'Kategorie hinzugefügt: ' + bezeichnung
|
|
|
FROM dbo.Kategorie
|
|
|
WHERE KategorieNr = @kategorienr
|
|
|
EXEC dbo.sp_insert_journal @themanr, @mutierer, @kat
|
|
|
|
|
|
END
|
|
|
ELSE
|
|
|
BEGIN
|
|
|
IF @aktiv = 0
|
|
|
BEGIN
|
|
|
UPDATE nebenkategorie
|
|
|
SET aktiv = @aktiv, mutiert_am = GETDATE(), mutierer = @mutierer
|
|
|
WHERE themanr = @themanr
|
|
|
AND kategorienr = @kategorienr
|
|
|
|
|
|
SELECT @kat = 'Kategorie entfernt: ' + bezeichnung
|
|
|
FROM dbo.Kategorie
|
|
|
WHERE KategorieNr = @kategorienr
|
|
|
EXEC dbo.sp_insert_journal @themanr, @mutierer, @kat
|
|
|
END
|
|
|
END
|
|
|
|
|
|
END
|
|
|
|
|
|
GO
|
|
|
/****** Object: StoredProcedure [dbo].[sp_update_spalten] Script Date: 12.05.2013 10:11:33 ******/
|
|
|
SET ANSI_NULLS OFF
|
|
|
GO
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[sp_update_spalten]
|
|
|
@tablename varchar(255)
|
|
|
AS
|
|
|
begin
|
|
|
declare @len int
|
|
|
declare @inhalt varchar(30)
|
|
|
declare @col varchar(30)
|
|
|
declare @readonly int
|
|
|
declare @dbkey int
|
|
|
declare @alshacken int
|
|
|
declare @ierrorcode int
|
|
|
declare @spaltenkey int
|
|
|
declare @aktiv int
|
|
|
declare @tiptext varchar(255)
|
|
|
declare xcursor cursor for
|
|
|
SELECT column_name
|
|
|
from INFORMATION_SCHEMA.Columns
|
|
|
where table_name = @tablename
|
|
|
open xcursor
|
|
|
FETCH NEXT FROM xcursor into @col
|
|
|
WHILE @@FETCH_STATUS = 0 BEGIN
|
|
|
execute sp_get_dbkey 'spalten', @dbkey output, @ierrorcode output
|
|
|
set @spaltenkey=@dbkey
|
|
|
|
|
|
set @inhalt=@col
|
|
|
set @readonly=0
|
|
|
set @aktiv=1
|
|
|
set @tiptext=''
|
|
|
set @len=100
|
|
|
set @alshacken=0
|
|
|
if upper(@col)='ERSTELLT_AM' begin
|
|
|
set @inhalt='Erstellungsdatum'
|
|
|
set @len=100
|
|
|
set @readonly=1
|
|
|
end
|
|
|
if upper(@col)='MUTIERT_AM' begin
|
|
|
set @inhalt='Mutationsdatum'
|
|
|
set @len=100
|
|
|
set @readonly=1
|
|
|
end
|
|
|
if upper(@col)='MUTIERER' begin
|
|
|
set @inhalt='Mutiert durch'
|
|
|
set @len=40
|
|
|
set @readonly=1
|
|
|
end
|
|
|
if upper(@col)='AKTIV' begin
|
|
|
set @inhalt='Aktiv'
|
|
|
set @len=40
|
|
|
set @alshacken=0
|
|
|
end
|
|
|
|
|
|
insert into spalten (eintragnr,tabelle,tabellenspalte,spalte,readonly,aktiv,erstellt_am, mutiert_am,mutierer,mandantnr,alsHacken,tiptext, breite, reihenfolge)
|
|
|
values(@spaltenkey,@tablename,@col,@inhalt,@readonly,@aktiv,getdate(),getdate(),-1,1,@alshacken,@tiptext,@len,0)
|
|
|
FETCH NEXT FROM xcursor into @col
|
|
|
end
|
|
|
close xcursor
|
|
|
deallocate xcursor
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|