-- ================================================================================================================
-- Stored Procedures generated by LLBLGen v1.21.2003.712 Final on Sonntag, 23. Juli 2017, 07:54:20
-- For the Low Level Business Logic Layer for the database 'vertragsverwaltung'
-- ================================================================================================================
SET NOCOUNT ON
GO
USE [vertragsverwaltung]
GO

-- ========================================================================================================
-- [Stored Procedures generated for table:  MwstSatz]
GO

-- //// Insert Stored procedure.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_MwstSatz_Insert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_MwstSatz_Insert]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will insert 1 row in the table 'MwstSatz'
-- Gets: @iJahr int
-- Gets: @fMwStSatz float(53)
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_MwstSatz_Insert]
	@iJahr int,
	@fMwStSatz float(53),
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- INSERT a new row in the table.
INSERT [dbo].[MwstSatz]
(
	[Jahr],
	[MwStSatz]
)
VALUES
(
	@iJahr,
	@fMwStSatz
)
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Update Stored procedure for updating one single row.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_MwstSatz_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_MwstSatz_Update]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will update an existing row in the table 'MwstSatz'
-- Gets: @iJahr int
-- Gets: @fMwStSatz float(53)
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_MwstSatz_Update]
	@iJahr int,
	@fMwStSatz float(53),
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- UPDATE an existing row in the table.
UPDATE [dbo].[MwstSatz]
SET 
	[MwStSatz] = @fMwStSatz
WHERE
	[Jahr] = @iJahr
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Delete Stored procedure using Primary Key.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_MwstSatz_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_MwstSatz_Delete]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will delete an existing row from the table 'MwstSatz'
-- using the Primary Key. 
-- Gets: @iJahr int
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_MwstSatz_Delete]
	@iJahr int,
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- DELETE an existing row from the table.
DELETE FROM [dbo].[MwstSatz]
WHERE
	[Jahr] = @iJahr
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Select Stored procedure, based on Primary Key.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_MwstSatz_SelectOne]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_MwstSatz_SelectOne]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will select an existing row from the table 'MwstSatz'
-- based on the Primary Key.
-- Gets: @iJahr int
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_MwstSatz_SelectOne]
	@iJahr int,
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- SELECT an existing row from the table.
SELECT
	[Jahr],
	[MwStSatz]
FROM [dbo].[MwstSatz]
WHERE
	[Jahr] = @iJahr
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Select All Stored procedure.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_MwstSatz_SelectAll]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_MwstSatz_SelectAll]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will select all rows from the table 'MwstSatz'
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_MwstSatz_SelectAll]
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- SELECT all rows from the table.
SELECT
	[Jahr],
	[MwStSatz]
FROM [dbo].[MwstSatz]
ORDER BY 
	[Jahr] ASC
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- [End of Stored Procedures for table:     MwstSatz]
-- ========================================================================================================
GO
