Support for SQL CMD Mode
Please add support for SQL CMD mode. When SSMS is in SQL CMD mode, SQL Prompt pretty much becomes disabled when :setvar is used to define an object (e.g. table) name. Thus, in the code:
:setvar mytable "dbo.mytable"
select * from $(mytable)
SQL Prompt is of no use. SQL Prompt should be able to resolve $(mytable) to the base object.
This is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Biff Douglass commented
Wow! I just got SQL Prompt through work a while back and love it, but was blown away by the fact that when working with scripts that have SQLCMD code in them $() variable names or :setvar, :r, etc., it chokes big time and is pretty much worthless. Been looking through the suggestions and it looks to me like RedGate choses to work on "easy" prblems and not real ones. Why doesn't SQL Prompt handle SQLCMD scripts? One of the comments from over a year ago indicates RedGate was starting work on this. When will it be done?
-
Doug commented
Jim, please delete this idea and vote on http://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/2372403-support-for-sql-cmd-mode. It is the same issue.
-
Janet Ryan commented
Most of our development is writing scripts and using SQLCMD vars. SQL Prompt is almost useless, even though our company licenses it for us.
-
Iain Knight commented
Also currently in VS2012 sql prompt does not provide any completion while in SQLCMD mode
-
Doug commented
Even if there is no :setvar in the code (e.g. variable values are passed in when the script is executed), SQL Prompt should still be able to format the code (e.g. just use some kind of internal placeholder for $(...) 'tokens') and perform other functions such as uppercase keywords, etc. SQL Prompt should also be able to recognize (and perhaps ignore as appropriate) other SQLCMD related keywords (e.g. :r, :error, :list, etc.)
-
Doug commented
I have been told by Red-Gate tech support that support for SQLCMD mode is in queue. I don't know if that means it is under review, in the works, planned, etc. If this is something other than a blurb in the suggestion list, can you update the status?