Initial Commit of the PDM project (ready for DWS migration)
This commit is contained in:
14
helpers/queries/DWS_GET_VV-57.sql
Normal file
14
helpers/queries/DWS_GET_VV-57.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
SELECT DISTINCT
|
||||
d.DocumentID,
|
||||
d.Filename AS [FileName],
|
||||
--p.Path AS [FolderPath],
|
||||
p.Path + d.Filename AS [FullVaultPath]
|
||||
--v.ValueText,
|
||||
--d.DocumentID
|
||||
--d.CurrentVersion
|
||||
FROM [Drilling_Test].[dbo].[Documents] d
|
||||
INNER JOIN [Drilling_Test].[dbo].[DocumentsInProjects] dp on d.[DocumentID] = dp.DocumentID
|
||||
INNER JOIN [Drilling_Test].[dbo].[Projects] p on dp.ProjectID = p.ProjectID
|
||||
INNER JOIN [Drilling_Test].[dbo].[VariableValue] v on d.DocumentID = v.DocumentID
|
||||
WHERE v.VariableID = 57 and p.Path like '%DWS%'
|
||||
ORDER BY [FullVaultPath] asc;
|
||||
24
helpers/queries/DWS_VV-57_FullList.sql
Normal file
24
helpers/queries/DWS_VV-57_FullList.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
Here we are basically just doing SELECT * FROM VariableValue WHERE VariableID = 57
|
||||
The reason we are doing all the join statements is we are trying to target only the files in the
|
||||
DWS folder, so we need the other tables in order to construct a path
|
||||
*/
|
||||
|
||||
SELECT
|
||||
v.VariableID,
|
||||
v.DocumentID,
|
||||
v.ProjectID,
|
||||
v.RevisionNo,
|
||||
v.ConfigurationID,
|
||||
v.ValueText,
|
||||
v.ValueInt,
|
||||
v.ValueFloat,
|
||||
v.ValueDate,
|
||||
v.ValueCache,
|
||||
v.IsLongText
|
||||
FROM [Drilling_Test].[dbo].[Documents] d
|
||||
INNER JOIN [Drilling_Test].[dbo].[DocumentsInProjects] dp on d.[DocumentID] = dp.DocumentID
|
||||
INNER JOIN [Drilling_Test].[dbo].[Projects] p on dp.ProjectID = p.ProjectID
|
||||
INNER JOIN [Drilling_Test].[dbo].[VariableValue] v on d.DocumentID = v.DocumentID
|
||||
WHERE v.VariableID = 57 and p.Path like '%DWS%'
|
||||
ORDER BY v.DocumentID asc;
|
||||
14
helpers/queries/Find_Duplicate_Rows.sql
Normal file
14
helpers/queries/Find_Duplicate_Rows.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
SELECT TOP (1000) [ConfigurationID]
|
||||
,[ConfigurationName]
|
||||
FROM [_Citadel_CS].[dbo].[DocumentConfiguration]
|
||||
|
||||
SELECT *
|
||||
FROM [_Citadel_CS].[dbo].[DocumentConfiguration]
|
||||
WHERE ConfigurationName IN (
|
||||
SELECT ConfigurationName
|
||||
FROM [_Citadel_CS].[dbo].[DocumentConfiguration]
|
||||
GROUP BY ConfigurationName
|
||||
HAVING COUNT(*) > 1
|
||||
);
|
||||
|
||||
|
||||
6
helpers/queries/Get_All_VV_Per_DocID.sql
Normal file
6
helpers/queries/Get_All_VV_Per_DocID.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- Get all distinct VariableIDs for a given DocumentID
|
||||
-- Pass DocumentID as parameter (?)
|
||||
SELECT DISTINCT VariableID
|
||||
FROM [Drilling_Test].[dbo].[VariableValue]
|
||||
WHERE DocumentID = ?
|
||||
|
||||
9
helpers/queries/INSERT_VV50_Copy.sql
Normal file
9
helpers/queries/INSERT_VV50_Copy.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Insert a VariableValue row that mirrors an existing VV-57 row but with
|
||||
-- VariableID = 50 (used by copy_57_to_50 task).
|
||||
-- Parameter order MUST match build_params() in copy_57_to_50:
|
||||
-- VariableID, DocumentID, ProjectID, RevisionNo, ConfigurationID,
|
||||
-- ValueText, ValueInt, ValueFloat, ValueDate, ValueCache, IsLongText
|
||||
INSERT INTO [Drilling_Test].[dbo].[VariableValue]
|
||||
(VariableID, DocumentID, ProjectID, RevisionNo, ConfigurationID,
|
||||
ValueText, ValueInt, ValueFloat, ValueDate, ValueCache, IsLongText)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
|
||||
Reference in New Issue
Block a user