cd\
set DB_USER=$INSTALLER_DATABASE_SERVER_USERID$
@set DB_PWD=$INSTALLER_DATABASE_SERVER_PASSWORD$
set DB_SERVER=$DATABASE_SERVER_HOST$
set DB_NAME=$DATABASE_NAME$

@sqlcmd -U%DB_USER% -P"%DB_PWD%" -d"%DB_NAME%" -S%DB_SERVER% -Q "Select 1 "

I want to store output value 1 in the variable to validate the message dailog to rule with $EXECUTE_STDOUT$ or custom variable.
Please share me the syntax and query

This is Preinstall section