-
Notifications
You must be signed in to change notification settings - Fork 108
Add option to cast XML results as nvarchar(max) in order to work with sqlcmd on Linux #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -526,7 +526,11 @@ BEGIN | |
END; | ||
GO | ||
|
||
-- @CastToNvarchar is for use with sqlcmd in order to | ||
-- capture the full output. | ||
-- e.g. sqlcmd -y0 -Q "EXEC tSQLt.XmlResultFormatter @CastToNvarchar=1" | ||
CREATE PROCEDURE tSQLt.XmlResultFormatter | ||
@CastToNvarchar int = 0 | ||
AS | ||
BEGIN | ||
DECLARE @XmlOutput XML; | ||
|
@@ -735,7 +739,14 @@ BEGIN | |
FOR XML EXPLICIT | ||
); | ||
|
||
EXEC tSQLt.Private_PrintXML @XmlOutput; | ||
If @CastToNvarchar = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than adding IF statement there, it would probably better be moved to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do. Is there a CI framework that runs the tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently you can only do that locally. If you go to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, you won't be able to do that on Linux ... However as I see from commits, that @mbt1 is currently working on setting automated tests on GitHub so there might be such possibility in the near future. |
||
BEGIN | ||
SELECT CAST(@XmlOutput AS nvarchar(max)) | ||
END | ||
ELSE | ||
BEGIN | ||
EXEC tSQLt.Private_PrintXML @XmlOutput; | ||
END | ||
END; | ||
GO | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.