What are the command line argumnets for SSMS (SQL Server Management Studio)

  • ..for 2008 and or 2005 (I have both although I prefer 2008).

    I have found the BOL Page on the basic command line arguments for SSMS.exe however I can't believe the application is limnited to just those listed in BOL. I'm thinking there are more arguments tha are 'undocumented'. Does anyone know of any undocumented arguments for SSMS version 2005 or 2008 (is they differ)? Also any tricks on laucnhing SSMS to do various things would be neat to know such as how to setup a conmfiguration file (if such a thing exists or is possible with SSMS).

    I have a Logitech keyboard with the cutomizable buttons for launching apps and I was setting up one to launch SSMS 2008 and connect to a specific DB (the one I use most often) so I could convert many steps into the push of a button. While I can get SSMS 2008 to load (via NT AUthentication) and connect to a specific DB there are a few things missing. For one the object explorer on the left side of SSMS is blank when I luanhc from the command line.

    FROM BOL 2008:

    [scriptfile] [projectfile] [solutionfile]

    [-S servername] [-d databasename] [-U username] [-P password]

    [-E] [-nosplash] [-?]

    Arguments

    scriptfile

    Specifies one or more script files to open. The parameter must contain the full path to the files.

    projectfile

    Specifies a script project to open. The parameter must contain the full path to the script project file.

    solutionfile

    Specifies a solution to open. The parameter must contain the full path to the solution file.

    [-S servername]

    Server name

    [-d databasename]

    Database name

    [-U username]

    User name when connecting with SQL Server Authentication

    [-P password]

    Password when connecting with SQL Server Authentication

    [-E]

    Connect using Windows authentication

    -nosplash

    Prevents SQL Server Management Studio from displaying the splash screen graphic while opening. Use this option when connecting to the computer running SQL Server Management Studio by means of Terminal Services over a connection with a limited bandwidth. This argument is not case-sensitive and may appear before or after other arguments

    [-?]

    Displays command line help

    Kindest Regards,

    Just say No to Facebook!
  • None that I know of.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Can I ask why?

    why not just schedule an ssis package to do what you want done?

  • villersk (5/5/2009)


    Can I ask why?

    why not just schedule an ssis package to do what you want done?

    Villersk - Did you reply to the wrong post? I ask only because I don't understand how an SSIS package would be used to load SSMS with a preconfigured environment.

    Kindest Regards,

    Just say No to Facebook!
  • I was just confused. Doesn't seem like loading SSMS and opening the db connection in one step is much of a time saver.

    I thought maybe you had a pre-configured action to take on this connection...in which case you could use SSIS.

    Anyways...I find vbscript sendkey function quite nice in areas where batch commands are lacking.

    maybe vbscript can help you get where you are headed

  • Its more then just loading and connecting to a DB because that could be achieved via a SQL LOgin with a Default DB set to the DB I use most. What I typically do is load SSMS, connect to multiple SQL Server Boxes (so they show up in the Explorer on the left side of SSMS) and then load Actovoty report and a new query window.

    Kindest Regards,

    Just say No to Facebook!
  • ya man....vbscript sendkeys to the rescue.

    Here is some vbscript example code to get you started: pop it in a txt file and save it with .vbs extension and run it:

    Option Explicit

    Dim objShell, WshShell

    set objShell = CreateObject("WScript.Shell")

    objShell.Run("cmd")

    WScript.Sleep 500

    objShell.SendKeys """C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"""

    objShell.SendKeys "{ENTER}"

    WScript.Sleep 500

    objShell.SendKeys "{ESC}"

    WScript.Sleep 500

    objShell.SendKeys "%(F)"

    WScript.Sleep 500

    objShell.SendKeys "{ENTER}"

    -----------------

    Also...here is a link to some sendkey help

    http://cwashington.netreach.net/main/library/sendkeys.html

  • btw - you could also use registered servers

  • villersk (11/4/2009)


    btw - you could also use registered servers

    Could you elaborate on that? Proivide an example?

    Kindest Regards,

    Just say No to Facebook!
  • In SSMS (I am using 2008), go to view->Registered Servers.

    This will open a 'registered servers' tab. It appears on the left with the 'object explorer'.

    Along the top you will see an icon for all of the server types. (SQL, SSAS, SSIS, SSRS)

    In the SQL Server area there is a folder named 'Local Server Groups'.

  • accidentally posted before I was finished...................

    right click on that folder and hit 'New Server Registration'. Then fill out the form.

    When you open SSMS it will open registered servers and you can see all the servers you registered. You can even organize them by group.

    Helps out if you work in multiple environments.

  • once you have finished registering all servers in your environment and orginanized them you can export the settings as a file and share with others on your team.

    - right click 'local server groups'->tasks-->import or export

  • villersk (11/4/2009)


    once you have finished registering all servers in your environment and orginanized them you can export the settings as a file and share with others on your team.

    - right click 'local server groups'->tasks-->import or export

    I use the Registered Serves, in SSMS 2008 as you have described but I had not tried to export them. I just troed this but still did not find anything within the XML file the xport created, that helps with identofying Command line/startup values for the SSMS executable. Am I just missing something obvious?

    Thanks

    Kindest Regards,

    Just say No to Facebook!
  • the point is that you dont need command line startup values at all.

    In your first post it sounded like you wanted to open up ssms and have all your db's connected to in object explorer. (was I wrong??)

    I was suggesting using registered servers in conjunction with object expplorer to achieve something similar to this.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply