Removed references to database [VEPROMS] so that the stored procedure would work regardless of the database being used.

This commit is contained in:
Rich 2011-06-13 11:52:20 +00:00
parent 67873fd6c6
commit beb7b850cd

View File

@ -2132,7 +2132,7 @@ INSERT INTO [Entries] ([ContentID],[DocID],[DTS],[UserID])
FROM [Entries] EE JOIN @Children NN on NN.ContentID = EE.ContentID
JOIN @NewDocuments ND on EE.[DocID] = ND.[DocID]
-- Logic to Create DROUsages for these newly created documents
INSERT INTO [VEPROMS].[dbo].[DROUsages] ([DocID],[ROID],[Config],[DTS],[UserID],[RODbID])
INSERT INTO [DROUsages] ([DocID],[ROID],[Config],[DTS],[UserID],[RODbID])
SELECT ND.[NewDocID],[ROID],[Config],@DTS,@UserID,[RODbID]
FROM [DROUsages] RR
JOIN @NewDocuments ND on RR.[DocID] = ND.[DocID]
@ -2140,7 +2140,7 @@ INSERT INTO [VEPROMS].[dbo].[DROUsages] ([DocID],[ROID],[Config],[DTS],[UserID],
-- Entries are done
-- SELECT * From Entries EE JOIN Documents DD on ee.DocID = DD.DocID where EE.DTS = @DTS and EE.UserID = @UserID
-- <<< Copy RoUsages >>>
INSERT INTO [VEPROMS].[dbo].[RoUsages] ([ContentID],[ROID],[Config],[DTS],[UserID],[RODbID])
INSERT INTO [RoUsages] ([ContentID],[ROID],[Config],[DTS],[UserID],[RODbID])
SELECT NN.[NewContentID],CAST([ROUsageID] as nvarchar(16)),[Config],@DTS,@UserID,[RODbID]
FROM [RoUsages] RR Join @Children NN on RR.ContentID = NN.ContentID
-- Update content records for newly copied records to use correct RO usage ids in the RO tags