SQLCMD variables

Refactors and formats SQL code.

SQLCMD variables

Postby drsql » Tue Jan 16, 2007 10:57 pm

A nice enhancement would be to support the SQLCMD variables that allow you to build scripts like:

Code: Select all
:setvar database dbName

select *
from   $(databaseName).dbo.tablename

I build many of my scripts like this in order to support (too many) different databases.

Posts: 39
Joined: Wed Aug 16, 2006 4:14 pm

Postby Daniel Handley » Mon Jan 22, 2007 5:17 pm


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.
Daniel Handley
Red Gate Software Ltd
Daniel Handley
Posts: 198
Joined: Mon Feb 07, 2005 2:05 pm
Location: Red Gate Software

Wanted: SQLCMD support in SQL Refactor

Postby anildas » Mon Feb 25, 2008 9:27 pm

The last update to this issue was posted on January 22, 2007. Any news?
Posts: 7
Joined: Mon Feb 25, 2008 9:19 pm
Location: San Diego, California, USA

Postby tanya » Tue Feb 26, 2008 12:24 pm


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.

Posts: 252
Joined: Mon Apr 30, 2007 7:29 pm

Support for SQLCMD mode needed.

Postby weswinkler » Tue Sep 29, 2009 12:19 am

Consider this an urgent request for this feature!

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
Posts: 34
Joined: Tue Nov 11, 2008 7:12 pm

Postby fatherjack » Wed Oct 07, 2009 8:31 am

I would also support this feature being included ASAP
Senior DBA
Careers South West Ltd
Posts: 224
Joined: Tue Mar 13, 2007 11:33 am
Location: Cornwall

Return to SQL Refactor Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests