2025-06-25 11:25:55 +02:00

34 lines
876 B
Transact-SQL

-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[sp_getTVElements]
@idReport as int
AS
BEGIN
SET NOCOUNT ON;
SELECT [IdSezione]
,[Descrizione]
,[DtCancellazione]
,[IdSezionePadre]
,[DtCreazione]
,[Nome]
,[FlgSezione]
,[ClasseRealizzazione]
,[IdReport]
,[TpSezione]
,[Utente]
,[Ordine]
,[TpInclusione]
,[ClasseVisualizzazione]
,[NomeControlloGruppo]
,[IsDefault]
,[IsMandatory]
,[internalSectionCode]
,[IsBold]
,(select count(*) FROM [dbo].[Sezione] WHERE [IdSezionePadre]=sc.[IdSezione]) childnodecount
FROM [dbo].[Sezione] sc
WHERE [IdSezionePadre] is NULL AND IdReport = @idReport
ORDER BY [Ordine]
END