-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ccb-hms/issue-50
Issue 50
- Loading branch information
Showing
8 changed files
with
263 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
This is a debugging tool to help identify tables that fail to translate and re-run | ||
their translations once a bugfix has been proposed. | ||
*/ | ||
|
||
DROP TABLE IF EXISTS #tmpRawTables | ||
DROP TABLE IF EXISTS #tmpTranslatedTables | ||
|
||
-- loop over all missing tables in the last release | ||
SELECT TABLE_NAME | ||
INTO #tmpRawTables | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'Raw' | ||
|
||
SELECT TABLE_NAME | ||
INTO #tmpTranslatedTables | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'Translated' | ||
|
||
DROP TABLE IF EXISTS #tmpDebugTables | ||
SELECT R.TABLE_NAME INTO #tmpDebugTables FROM #tmpRawTables R LEFT OUTER JOIN #tmpTranslatedTables T ON R.TABLE_NAME = T.TABLE_NAME WHERE T.TABLE_NAME IS NULL ORDER BY R.TABLE_NAME | ||
|
||
SELECT * FROM #tmpDebugTables | ||
|
||
DECLARE cTableNames CURSOR FOR SELECT * FROM #tmpDebugTables ORDER BY TABLE_NAME | ||
DECLARE @currTableName varchar(256) | ||
OPEN cTableNames | ||
|
||
FETCH NEXT FROM cTableNames INTO @currTableName | ||
WHILE @@FETCH_STATUS = 0 | ||
BEGIN | ||
PRINT @currTableName | ||
EXECUTE dbo.spTranslateTable | ||
'Raw' | ||
,@currTableName | ||
,'Translated' | ||
,@currTableName | ||
FETCH NEXT FROM cTableNames INTO @currTableName | ||
END | ||
|
||
CLOSE cTableNames | ||
DEALLOCATE cTableNames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- Manually run spTranslateTable for debugging | ||
|
||
DECLARE @RC int | ||
DECLARE @SourceTableSchema varchar(8000) | ||
DECLARE @SourceTableName varchar(128) | ||
DECLARE @DestinationTableSchema varchar(8000) | ||
DECLARE @DestinationTableName varchar(128) | ||
|
||
-- TODO: Set parameter values here. | ||
-- CAFE_G | ||
SET @SourceTableSchema = 'Raw' | ||
SET @SourceTableName = 'POOLTF_G' | ||
SET @DestinationTableSchema = 'Translated' | ||
|
||
EXECUTE @RC = [dbo].[spTranslateTable] | ||
@SourceTableSchema | ||
,@SourceTableName | ||
,@DestinationTableSchema | ||
,@DestinationTableName = @SourceTableName | ||
|
||
EXEC ('SELECT TOP 10 * FROM ' + @DestinationTableSchema + '.' + @SourceTableName + ' ORDER BY SEQN') | ||
EXEC ('SELECT TOP 10 * FROM ' + @SourceTableSchema + '.' + @SourceTableName + ' ORDER BY SEQN') | ||
|
||
-- SELECT * FROM Metadata.VariableCodebook V WHERE V.TableName='POOLTF_G' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.