SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Management Studio in SQLCMD mode


Management Studio in SQLCMD mode

Author
Message
Ola Hallengren
Ola Hallengren
Right there with Babe
Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)

Group: General Forum Members
Points: 728 Visits: 1938
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
JamieX
JamieX
SSC Eights!
SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)

Group: General Forum Members
Points: 971 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.
Ola Hallengren
Ola Hallengren
Right there with Babe
Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)Right there with Babe (728 reputation)

Group: General Forum Members
Points: 728 Visits: 1938
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search