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.
60 lines
3.1 KiB
60 lines
3.1 KiB
USE [Vertragsverwaltung_20160404]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[sp_rpt_oema] Script Date: 02.12.2016 09:08:53 ******/
|
|
DROP PROCEDURE [dbo].[sp_rpt_oema]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[sp_rpt_oema] Script Date: 02.12.2016 09:08:55 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[sp_rpt_oema]
|
|
AS
|
|
BEGIN
|
|
|
|
|
|
|
|
SELECT manr AS id ,
|
|
NULL AS Parentid ,
|
|
name + ' ' + vorname AS Bezeichnung ,
|
|
1 AS imageindex ,
|
|
name + ' ' + vorname AS ErweiterteSuche ,
|
|
0 AS Sort
|
|
INTO #tmp2
|
|
FROM dbo.ma where aktiv=1
|
|
|
|
INSERT #tmp2
|
|
( id ,
|
|
parentid ,
|
|
bezeichnung ,
|
|
imageindex ,
|
|
ErweiterteSuche ,
|
|
sort
|
|
)
|
|
VALUES ( '0' ,
|
|
NULL ,
|
|
'Root' ,
|
|
0 ,
|
|
' ' ,
|
|
1
|
|
)
|
|
UPDATE #tmp2
|
|
SET parentid = 0
|
|
WHERE id <> 0
|
|
SELECT *
|
|
FROM #tmp2
|
|
ORDER BY parentid ,
|
|
sort ,
|
|
Bezeichnung
|
|
DROP TABLE #tmp2
|
|
|
|
RETURN
|
|
END
|
|
|
|
GO
|