USE [Vertragsverwaltung_20160404] GO /****** Object: StoredProcedure [dbo].[pr_key_tabelle_Insert] Script Date: 02.12.2016 09:08:54 ******/ DROP PROCEDURE [dbo].[pr_key_tabelle_Insert] GO /****** Object: StoredProcedure [dbo].[pr_key_tabelle_Insert] Script Date: 02.12.2016 09:08:54 ******/ 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