Skip to content

Commit

Permalink
debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
yarenylmz committed Dec 18, 2024
1 parent 2e20640 commit 422b854
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/demoTestsSqlCmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
-fix/print_table_limit
paths:
- "demo/UnitTests/**"
- ".github/workflows/demoTestsSqlCmd.yaml"
Expand Down Expand Up @@ -55,7 +56,8 @@ jobs:
-ServerInstance "${{ secrets.TARGET_SERVER_URI }}" `
-Database "${{ secrets.TARGET_DATABASE_NAME }}" `
-AccessToken "${{ steps.azure_access_token.outputs.azureAccessToken }}" `
-InputFile "SampleTests.sql"
-InputFile "SampleTests.sql" `
-Verbose
working-directory: ${{ env.WORKING_DIRECTORY }}
shell: pwsh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ BEGIN
IF @UnequalRowsExist > 0
BEGIN
EXEC [tSQLt_synapse].[Private_PrintTable] @ResultTableSchema, @ResultTable;
PRINT('Now drop')
SET @Cmd = 'DROP TABLE ' + @ResultTableWithSchema + ';'
EXEC [sp_executesql] @Cmd;
EXEC [tSQLt_synapse].[Fail] 'There exists unequal rows!';
Expand Down
4 changes: 4 additions & 0 deletions sql/tSQLt_synapse/StoredProcedures/Private_PrintTable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ BEGIN
END
ELSE
BEGIN
PRINT ('In print');
IF OBJECT_ID('tempdb..#column_max_len') IS NOT NULL
DROP TABLE #column_max_len;
CREATE TABLE #column_max_len ([column_name] NVARCHAR(4000), [max_len] INT, [column_id] INT);
Expand Down Expand Up @@ -95,6 +96,8 @@ BEGIN
IF OBJECT_ID ('tempdb..#PrintTable') IS NOT NULL
TRUNCATE TABLE #PrintTable;

PRINT ('After truncate');

SET @Command = N'
SELECT RowText, ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS sequence
INTO #PrintTable
Expand All @@ -103,6 +106,7 @@ BEGIN
FROM [' + @SchemaName + '].[' + @TableName + ']
) t;';
EXEC [sp_executesql] @Command;
PRINT ('Before loop');

-- Loop table and print each row
DECLARE @rowCounter INT = 1;
Expand Down

0 comments on commit 422b854

Please sign in to comment.