Red Gate forums :: View topic - SQLCMD Variables
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Multi Script 1
SQL Multi Script 1 forum

SQLCMD Variables

Search in SQL Multi Script 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
cyates04



Joined: 04 Nov 2011
Posts: 5
Location: Kentucky

PostPosted: Thu Feb 16, 2012 2:46 pm    Post subject: SQLCMD Variables Reply with quote

I have a set of SQL scripts that utilize SQLCMD Variables......for example


:setvar Pub_Server "[team-1]"
:setvar Sub_Server "[team-1\Reporting]"
:setvar SubscriberDB "Reporting_team1"
:setvar PostSnapshotScript "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\repldata\index\indexfile.sql"

I've changed my variable names but you should be able to see the gist of what I am trying to accomplish. This portion of the script is at the top of my SQL script and will be called later on in the script. This works well in SSMS but doesn't using this utility. I receive a error - Incorrect syntax near ':'.

Is the use of SQLCMD Variables not supported with this utility? I could break the script out into 5 different variations and hard code in the values but trying to stay away from that.
Back to top
View user's profile Send private message
dlkj



Joined: 14 Aug 2007
Posts: 151
Location: Red Gate Software, Cambridge

PostPosted: Fri Feb 17, 2012 3:03 pm    Post subject: Reply with quote

Hi cyates04,

SQL Multi Script doesn't support SQLCMD variables. We have rough feature parity with SSMS which doesn't support them either.

Thanks,
--
Daniel
Back to top
View user's profile Send private message
cyates04



Joined: 04 Nov 2011
Posts: 5
Location: Kentucky

PostPosted: Mon Feb 20, 2012 7:47 pm    Post subject: Reply with quote

Thanks for the quick response.
Back to top
View user's profile Send private message
dcam



Joined: 24 Jul 2012
Posts: 1

PostPosted: Tue Jul 24, 2012 6:40 am    Post subject: SQLCMD supported by SMSS Reply with quote

Hi,

The SQLCMD syntax is supported by management studio. Using the 2008 client there is the option under the query menu to execute scripts using the SQLCMD syntax.

Will there be support for SQLCMD syntax in future versions on MultiScript?

David
Back to top
View user's profile Send private message
dlkj



Joined: 14 Aug 2007
Posts: 151
Location: Red Gate Software, Cambridge

PostPosted: Mon Jul 30, 2012 11:32 am    Post subject: Reply with quote

Hi David,

Thanks for letting us know about that. It's amazing what's hidden in SSMS.

Unfortunately we aren't planing to make any updates to SQL Multi Script in the immediate future.

Daniel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group