SQLCMD variables
drsql
Posts: 44 Bronze 3
A nice enhancement would be to support the SQLCMD variables that allow you to build scripts like:
I build many of my scripts like this in order to support (too many) different databases.
Thanks
:setvar database dbName select * from $(databaseName).dbo.tablename
I build many of my scripts like this in order to support (too many) different databases.
Thanks
Comments
I have added this to the wish list for inclusion in the discussions when we begin to work on the next version.
Thanks for the feedback.
Regards
Dan
Red Gate Software Ltd
This feature has not been targeted to any specific release as yet because we have not got enough requests for the feature.
However, if more user requests flow in you will see it fixed in the near future.
Thanks,
Tanya
I have begun working on projects generated with the Microsoft Visual Studio Team Edition Database Developer Version (aka DataDude). Many of the scripts must be run in SQLCMD mode in order to utilize project variables, stored in *.sqlcmdvars files.
When such a query is loaded into the SQL Management Studio and the query session is set to SQLCMD mode, it parses correctly and executes correctly. However, SQL Refactor cannot perform ANY functions, claiming there are errors. The script summarization feature, which I find particularly useful, is completely unavailable in SQLCMD mode.
See my post in the related forum for SQL Prompt. http://www.red-gate.com/MessageBoard/viewtopic.php?t=9671
Senior DBA
Careers South West Ltd