You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
4.7 KiB
79 lines
4.7 KiB
USE [Vertragsverwaltung_20160404]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[pr_Profil_Update] Script Date: 02.12.2016 09:08:54 ******/
|
|
DROP PROCEDURE [dbo].[pr_Profil_Update]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[pr_Profil_Update] Script Date: 02.12.2016 09:08:54 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
---------------------------------------------------------------------------------
|
|
-- Stored procedure that will update an existing row in the table 'Profil'
|
|
-- Gets: @iProfilnr int
|
|
-- Gets: @iMitarbeiternr int
|
|
-- Gets: @sBezeichnung varchar(25)
|
|
-- Gets: @blobV_Uebersicht image
|
|
-- Gets: @sV_Aktiv_Vertragselemente varchar(10)
|
|
-- Gets: @bV_Aktiv_Vertragspartner bit
|
|
-- Gets: @bV_Struktur_Details bit
|
|
-- Gets: @bSelektionsart bit
|
|
-- Gets: @bStandard bit
|
|
-- Gets: @daErstellt_am datetime
|
|
-- Gets: @daMutiert_am datetime
|
|
-- Gets: @iMutierer int
|
|
-- Gets: @bAktiv bit
|
|
-- Gets: @sV_Sort varchar(1024)
|
|
-- Gets: @sV_Register varchar(1024)
|
|
-- Returns: @iErrorCode int
|
|
---------------------------------------------------------------------------------
|
|
CREATE PROCEDURE [dbo].[pr_Profil_Update]
|
|
@iProfilnr int,
|
|
@iMitarbeiternr int,
|
|
@sBezeichnung varchar(25),
|
|
@blobV_Uebersicht image,
|
|
@sV_Aktiv_Vertragselemente varchar(10),
|
|
@bV_Aktiv_Vertragspartner bit,
|
|
@bV_Struktur_Details bit,
|
|
@bSelektionsart bit,
|
|
@bStandard bit,
|
|
@daErstellt_am datetime,
|
|
@daMutiert_am datetime,
|
|
@iMutierer int,
|
|
@bAktiv bit,
|
|
@sV_Sort varchar(1024),
|
|
@sV_Register varchar(1024),
|
|
@iErrorCode int OUTPUT
|
|
AS
|
|
SET NOCOUNT ON
|
|
-- UPDATE an existing row in the table.
|
|
UPDATE [dbo].[Profil]
|
|
SET
|
|
[Mitarbeiternr] = @iMitarbeiternr,
|
|
[Bezeichnung] = @sBezeichnung,
|
|
[V_Uebersicht] = @blobV_Uebersicht,
|
|
[V_Aktiv_Vertragselemente] = @sV_Aktiv_Vertragselemente,
|
|
[V_Aktiv_Vertragspartner] = @bV_Aktiv_Vertragspartner,
|
|
[V_Struktur_Details] = @bV_Struktur_Details,
|
|
[Selektionsart] = @bSelektionsart,
|
|
[Standard] = @bStandard,
|
|
[Erstellt_am] = @daErstellt_am,
|
|
[Mutiert_am] = @daMutiert_am,
|
|
[Mutierer] = @iMutierer,
|
|
[Aktiv] = @bAktiv,
|
|
[V_Sort] = @sV_Sort,
|
|
[V_Register] = @sV_Register
|
|
WHERE
|
|
[Profilnr] = @iProfilnr
|
|
-- Get the Error Code for the statement just executed.
|
|
|
|
if @bStandard=1 begin
|
|
update Profil set Standard=0 where Profilnr<>@iProfilnr and Mitarbeiternr=@iMitarbeiternr
|
|
end
|
|
|
|
SELECT @iErrorCode=@@ERROR
|
|
|
|
|
|
GO
|