Con più domande
Solve this STDOUT

Domanda
-
Hi, guys
i have a question to MSSQL -> ML-Service Python
MSSQL 2019 Standard Edition / CU16
my script
exec sp_execute_external_script @language=N'Python',
@Script=N''when run my script
the message is
STDOUT(s) From %%%%
Express Edition Will continue to be enforced
i know that is not error.
it could be ignore. but my another program recognize error about STDOUT.
so.. i must hidden or disappear that message
how can i hide or not to show this info?? ->> Express Edition Will continue to be enforced
Tutte le risposte
-
You can hide the message "Express Edition Will continue to be enforced" by redirecting the output of the script to the null device.
You can do this by adding the following command at the beginning of your script:
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'agent xp_cmdshell', 1;
GO
RECONFIGURE;
GOThis will enable the xp_cmdshell option, which allows you to execute command line commands from T-SQL.
Then you can redirect the output of your script to the null device by adding this command at the beginning of your script:
EXEC master..xp_cmdshell 'echo Express Edition Will continue to be enforced > NUL'
This will redirect the output of the message to the null device, effectively hiding it from your script's output.
Alternatively, you can also redirect the output of your script to a file and then read the file contents. This way you can check if the message is present in the file and act accordingly.
EXEC master..xp_cmdshell 'echo Express Edition Will continue to be enforced > file.txt'
You can then read the contents of the file using python and check if the message is present or not.Please keep in mind that redirecting the output to the null device or a file will not affect the execution of the script and the message will still be output by the system, but it will not be visible to the user. It's just a method to suppress the message from being displayed on the screen.
Also, some users have reported that they were able to suppress this message by disabling the "Agent Xp_cmdshell" configuration option by executing
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Agent Xp_cmdshell', 0;
GO
RECONFIGURE;
GOPlease be aware that disabling the Agent Xp_cmdshell may cause other issues with your script or other scripts that rely on it. And it's not recommended to disable it unless it's necessary for your use case.
It's also worth noting that the message "Express Edition Will continue to be enforced" is just a warning and it should not affect the execution of the script or the results of the script.
-
Stdout, also known as standard output, is the default file descriptor where a process can write output. In Unix-like operating systems, such as Linux, macOS X, and BSD, stdout is defined by the POSIX standard. Its default file descriptor number is 1. In the terminal, standard output defaults to the user's screen.
Regards,
Rachel Gomez