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.

49 lines
3.4 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

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