Added table function to return a list of Content records that contain a specified string.
Added stored procedure to standardize text (standard steps) Lazy Load font value. Return the correct EditItem when a step is deleted. Update the StepTabRibbon EditItem when the StepPanel EditItem is changed Get MyItemInfo if it is not set. Added missing logic to MyEditItem.
This commit is contained in:
@@ -4235,6 +4235,32 @@ IF (@@Error = 0) PRINT 'Procedure Creation: existsZTransition Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: existsZTransition Error on Creation'
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [FindText] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[FindText]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1)
|
||||
DROP FUNCTION [FindText];
|
||||
GO
|
||||
|
||||
Create FUNCTION [dbo].[FindText](@LookFor varchar(255))
|
||||
RETURNS @Results TABLE
|
||||
(
|
||||
ItemID int PRIMARY KEY,
|
||||
ContentID int
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
BEGIN
|
||||
insert into @Results
|
||||
select itemid,ii.contentid
|
||||
from items ii
|
||||
join contents cc on ii.contentid = cc.contentid
|
||||
where text like @LookFor
|
||||
RETURN
|
||||
END
|
||||
GO
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'TableFunction Creation: FindText Succeeded'
|
||||
ELSE PRINT 'TableFunction Creation: FindText Error on Creation'
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [getAffectedDRoUsages] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getAffectedDRoUsages]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [getAffectedDRoUsages];
|
||||
@@ -10024,6 +10050,41 @@ IF (@@Error = 0) PRINT 'Procedure Creation: purgeData Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: purgeData Error on Creation'
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [Standardize] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[Standardize]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [Standardize];
|
||||
GO
|
||||
|
||||
/*
|
||||
Standardize '%engineering evaluation%'
|
||||
Standardize '%preferred running order%'
|
||||
Standardize '%provide normal spray%'
|
||||
*/
|
||||
|
||||
CREATE PROCEDURE [dbo].[Standardize]
|
||||
(
|
||||
@LookFor varchar(255)
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN TRY -- Try Block
|
||||
BEGIN TRANSACTION
|
||||
DECLARE @ContentID INT
|
||||
SET @Contentid = (select min(ContentID) FROM FindText(@LookFor))
|
||||
UPDATE Items SET ContentID = @ContentID WHERE ItemID in(SELECT ItemID FROM FindText(@LookFor))
|
||||
IF( @@TRANCOUNT > 0 ) COMMIT
|
||||
END TRY
|
||||
BEGIN CATCH -- Catch Block
|
||||
IF( @@TRANCOUNT = 1 ) ROLLBACK -- Only rollback if top level
|
||||
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
|
||||
EXEC vlnErrorHandler
|
||||
END CATCH
|
||||
GO
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'Procedure Creation: Standardize Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: Standardize Error on Creation'
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [updateAnnotation] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[updateAnnotation]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [updateAnnotation];
|
||||
|
Reference in New Issue
Block a user