95 lines
4.5 KiB
Plaintext
95 lines
4.5 KiB
Plaintext
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_TestObjectTemplatesUpdate]') AND type in (N'P', N'PC'))
|
|
DROP PROCEDURE [dbo].[sp_TestObjectTemplatesUpdate]
|
|
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_TestObjectTemplatesUpdate]') AND type in (N'P', N'PC'))
|
|
BEGIN
|
|
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_TestObjectTemplatesUpdate] AS'
|
|
END
|
|
GO
|
|
ALTER PROCEDURE [dbo].[sp_TestObjectTemplatesUpdate]
|
|
@TemplateName nvarchar(255) = null
|
|
,@Icon nvarchar(50)
|
|
,@Description nvarchar(50)
|
|
,@LocalOnly bit
|
|
,@Version int
|
|
,@LastModifiedBy nvarchar(50)
|
|
,@CRC32 int
|
|
,@ISOTestObject nvarchar(255)
|
|
,@TestObjectType nvarchar(255)
|
|
,@LastModified datetime
|
|
,@ParentTemplate nvarchar(50)
|
|
,@SysBuilt bit
|
|
,@OrigTemplateName nvarchar(255)
|
|
,@Embedded bit
|
|
,@errorNumber int output
|
|
,@errorMessage nvarchar(250) output
|
|
|
|
AS
|
|
BEGIN
|
|
set @errorNumber = 0; set @errorMessage = space(0);
|
|
|
|
if(@TemplateName is null)
|
|
begin
|
|
RAISERROR(15600,-1,-1, 'sp_TestObjectTemplatesUpdate') /* Error 1560 - An invalid parameter or option was specified for procedure*/
|
|
end
|
|
else
|
|
begin
|
|
SET NOCOUNT ON;
|
|
declare @TemplateId int
|
|
set @TemplateId = dbo.foo_IdGetTemplate(@TemplateName)
|
|
|
|
UPDATE [dbo].[TestObjectTemplates]
|
|
SET [Icon] = @Icon
|
|
,[Description] = @Description
|
|
,[LocalOnly] = @LocalOnly
|
|
,[Version] = @Version
|
|
,[LastModifiedBy] = @LastModifiedBy
|
|
,[CRC32] = @CRC32
|
|
,[ISOTestObject] = @ISOTestObject
|
|
,[TestObjectType] = @TestObjectType
|
|
,[ISOFlag] = case when charindex('NONISO', @TestObjectType, 0) = 1 then 0 else 1 end
|
|
,[LastModified] = @LastModified
|
|
,[ParentTemplate] = @ParentTemplate
|
|
,[SysBuilt] = @SysBuilt
|
|
,[OrigTemplateName] = @OrigTemplateName
|
|
,[Embedded] = @Embedded
|
|
WHERE [TemplateId] = @TemplateId
|
|
end
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|