Added getRoUsagesForDocVersion and modified vesp_ListTables3 stored procedures

Updated how RO values are updated as a result of issues identified by Calvert data
Modified code to handle non-standard characters in StepType variable.
Chnaged how transitions are updated to utilize methods of Content and ContentInfo classes
This commit is contained in:
Rich
2014-05-14 02:07:03 +00:00
parent 249ddafe54
commit dd7f3a4148
4 changed files with 344 additions and 54 deletions

View File

@@ -8458,3 +8458,96 @@ GO
IF (@@Error = 0) PRINT 'Procedure Creation: getRevisionsByItemID Succeeded'
ELSE PRINT 'Procedure Creation: getRevisionsByItemID Error on Creation'
GO
/****** Object: StoredProcedure [getRoUsagesForDocVersion] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getRoUsagesForDocVersion]') AND OBJECTPROPERTY
(id,N'IsProcedure') = 1)
DROP PROCEDURE [getRoUsagesForDocVersion];
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE PROCEDURE [dbo].[getRoUsagesForDocVersion]
(
@VersionID int
)
WITH EXECUTE AS OWNER
AS
SELECT
[ROUsageID],
rr.[ContentID],
[ROID],
[Config],
[DTS],
[UserID],
[LastChanged],
[RODbID]
FROM [RoUsages] rr
INNER JOIN vefn_getversionitems(@VersionID) vi on rr.contentid = vi.contentid
RETURN
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: getRoUsagesForDocVersion Succeeded'
ELSE PRINT 'Procedure Creation: getRoUsagesForDocVersion Error on Creation'
GO
/****** Object: StoredProcedure [vesp_ListTables3] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_ListTables3]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [vesp_ListTables3];
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE procedure [dbo].[vesp_ListTables3]
WITH EXECUTE AS OWNER
AS
begin
select o.name TableName,c.name ColumnName,
case c.system_type_id
when 56 then 'int'
when 231 then 'nvarchar'
when 165 then 'varbinary'
when 167 then 'varchar'
when 239 then 'nchar'
when 175 then 'char'
when 61 then 'datetime'
when 104 then 'bit'
when 48 then 'TinyInt'
when 127 then 'BigInt'
when 241 then 'Xml'
when 62 then 'float'
when 189 then 'timestamp'
else '???' + cast(c.system_type_id as varchar(10)) end ItemType,
case c.system_type_id
when 56 then '0'
when 231 then case c.max_length when -1 then 'Max' else cast(c.max_length/2 as varchar(10)) end
when 165 then case c.max_length when -1 then 'Max' else cast(c.max_length as varchar(10)) end
when 167 then case c.max_length when -1 then 'Max' else cast(c.max_length as varchar(10)) end
when 239 then case c.max_length when -1 then 'Max' else cast(c.max_length/2 as varchar(10)) end
when 175 then case c.max_length when -1 then 'Max' else cast(c.max_length as varchar(10)) end
when 61 then '0'
when 104 then '0'
when 48 then '0'
when 189 then '0'
else '0' end ItemSize,
case when c.is_nullable=1 then 'Yes' else '' end AllowNulls,
case when c.is_identity=1 then 'Identity' else dc.definition end DefaultValue,
x.value Description
from sys.objects o
join sys.columns c on o.object_id=c.object_id
left join sysconstraints cn on o.object_id=cn.id and c.column_id=cn.colid
left join sys.default_constraints dc on dc.object_id = cn.constid
left join sys.extended_properties x on x.major_id = o.OBJECT_ID AND x.minor_id=c.column_id AND x.Name='MS_Description'
where o.type='U'
order by o.name,c.column_id
end
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: vesp_ListTables3 Succeeded'
ELSE PRINT 'Procedure Creation: vesp_ListTables3 Error on Creation'
GO