60 lines
1.8 KiB
Transact-SQL
60 lines
1.8 KiB
Transact-SQL
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_TemplateZonesGet]') AND type in (N'P', N'PC'))
|
||
DROP PROCEDURE [dbo].[sp_TemplateZonesGet]
|
||
GO
|
||
SET ANSI_NULLS ON
|
||
GO
|
||
SET QUOTED_IDENTIFIER ON
|
||
GO
|
||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_TemplateZonesGet]') AND type in (N'P', N'PC'))
|
||
BEGIN
|
||
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_TemplateZonesGet] AS'
|
||
END
|
||
GO
|
||
ALTER PROCEDURE [dbo].[sp_TemplateZonesGet]
|
||
@TemplateName nvarchar(255) = null
|
||
AS
|
||
BEGIN
|
||
SET NOCOUNT ON;
|
||
|
||
declare @TemplateId int
|
||
set @TemplateId = dbo.foo_IdGetTemplate(@TemplateName)
|
||
|
||
SELECT @TemplateName as [TemplateName]
|
||
,[ZoneName]
|
||
,[ZoneDescription]
|
||
,[Picture]
|
||
FROM [dbo].[TemplateZones] where @TemplateName is null or TemplateId = @TemplateId
|
||
END
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
GO
|