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.
ITSM/.svn/pristine/0e/0e3d465f26102d6430afef42eda...

44 lines
2.5 KiB

USE [Vertragsverwaltung_20160404]
GO
/****** Object: StoredProcedure [dbo].[my_servicekatalog_leistungen_struktur] Script Date: 02.12.2016 09:08:54 ******/
DROP PROCEDURE [dbo].[my_servicekatalog_leistungen_struktur]
GO
/****** Object: StoredProcedure [dbo].[my_servicekatalog_leistungen_struktur] Script Date: 02.12.2016 09:08:54 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE proc [dbo].[my_servicekatalog_leistungen_struktur]
@mitarbeiternr int,
@servicekatalognr int
AS
CREATE TABLE #tmpd(
[servicekatalognr] [int] ,
[bezeichnung] [varchar] (255) null,
[parentid] [int] ,
[securitylevelnr] [int],
) ON [DEFAULT]
declare @tmp int
declare xc cursor for
select servicekatalognr from servicekatalog where servicekatalognr=@servicekatalognr and securitylevelnr in (select SecurityLevelNr from dbo.Get_SecurityLevelTab(@mitarbeiternr))
open xc
fetch next from xc into @tmp
while @@fetch_status=0 begin
execute dbo.my_servicekatalog_struktur_down @tmp,1
fetch next from xc into @tmp
end
close xc
deallocate xc
--insert #tmpd (servicekatalognr, bezeichnung, parentid,securitylevelnr) values(0,'Service-Katalog',null,0)
--delete from #tmpd where securitylevelnr <
select * from #tmpd order by bezeichnung
GO