Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Management Studio in SQLCMD mode Expand / Collapse
Author
Message
Posted Thursday, July 31, 2008 7:44 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 31, 2014 10:00 PM
Points: 170, Visits: 1,880
I'm thinking about one thing regarding using Management Studio in SQLCMD mode.

Is there any way of enabling this from a script?

It could be a command that enables SQLCMD mode or it could be a special file extension that opens Management Studio in SQLCMD mode.

I know that it's easy to click on the icon for SQLCMD mode, but I would like be sure that anyone that is opening the script gets into the right mode automatically.

Ola Hallengren
http://ola.hallengren.com
Post #544381
Posted Thursday, July 31, 2008 8:03 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, October 15, 2010 8:23 AM
Points: 371, Visits: 437
well ... here's what I know - might get you going.

Tools Menu / Options / Query Execution / "By Default, Open queries in SQLCMD mode" check box.

this will auto turn it on for new queries.

Now -- when you save this, it is saved to the SqlOptions file in your profile
C:\Documents and Settings\ \Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell

So, I suppose you could set the option, copy the file, turn off the option and you will have two options files to work with.
Post #544395
Posted Thursday, July 31, 2008 8:18 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 31, 2014 10:00 PM
Points: 170, Visits: 1,880
Thanks, Jamie. I understand.

Now I was thinking more of publishing a SQLCMD file on a website and be sure that all people will open it in SQLCMD mode in Management Studio.

Ola Hallengren
http://ola.hallengren.com
Post #544411
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse