Description
Hi @yoleichen, @aasimkhan30,
Once again, this is more of an enhancement request than a bug.
When using Schema Designer and clicking on View Code, the generated DacFx deployment script fails to execute unless SQLCMD mode is enabled. However, many users are unfamiliar with this requirement and there is currently no documentation available that explains how to enable SQLCMD mode in the MSSQL extension for Visual Studio Code.
No SalesTransaction
table was created:
The problem with this approach is that when users try to execute the script, it either fails silently or shows a message that may be unclear or confusing. There’s no actionable guidance or help within the script itself to assist users in resolving the issue. To make things more challenging, there’s currently no documentation or guidance available on how to enable SQLCMD mode in the MSSQL extension. And if the user closes all windows and returns to Schema Designer, the table they just created is no longer present on the canvas—forcing them to start from scratch.
There is no easy way to solve this now, so I propose the following:
- Add a comment at the top of the generated script (before the first :setvar) explaining the need for SQLCMD mode:
/*
⚠️ IMPORTANT:
This script requires SQLCMD mode to be enabled in the MSSQL extension.
Learn how to enable it: https://aka.ms/vscode-mssql-sqlcmd-mode
*/
- The new aka.ms link (vscode-mssql-sqlcmd-mode) should include basic documentation and screenshots explaining how to:
- Open command palette → "MS SQL: Toggle SQLCMD Mode”
- Verify that SQLCMD mode is ON in the status bar