SQL SERVER – 2005 – Open SSMS From Command Prompt – sqlwb.exe Example

This article is written by request and suggestion of Sr. Web Developer at my organization. Due to nature of this article most of the content are referred from Book On-Line. sqlwb command prompt utility which opens SQL Server Management Studio. sqlwb command does not run queries from command prompt. sqlcmd utility runs queries from command prompt, read for more information.

The syntax of this sqlwb is very simple. I will copy complete syntax from BOL here :
[scriptfile] [projectfile] [solutionfile]
[-S servername] [-d databasename] [-U username] [-P password]
[-E] [-nosplash] [-?]

I use following script very frequently.

1) Open SQL Server Management Studio.

2) Open SQL Server Management Studio with windows authentication with no splash screen and default database as AdventureWorks
sqlwb -E -S SQLServerName -D AdventureWorksnosplash

3) Open SQL Server Management Studio with username and password with no splash screen and default database as AdventureWorks
sqlwb -S SQLServerName -U MyUserName -P MyPassWord -D AdventureWorksnosplash

To execute above commands you should have access to sqlwb.exe file. My local computer has sqlwb file in folder : C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE
Click on Start >> click on run >> type in following command to launch SQL Server Management Studio :
“C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlwb.exe” -E -S SQL -nosplash

Reference : Pinal Dave (http://blog.SQLAuthority.com)

30 thoughts on “SQL SERVER – 2005 – Open SSMS From Command Prompt – sqlwb.exe Example

  1. Great, but only one thing is bad, Object Explorer are not connected to server, so if you open SSMS in this way, and you need Object Explorer you have to connect it manually :-(


  2. Hi,
    When i tried to open sqlwb.exe/Management Studio, its just return me the popup or you can say main page of Management Studio 2005 and then gone.
    Means sqlwb.exe unable to execute properly. Does Something is hanging/blocking in between ?
    So when we execute any .exe file, Does it requires any extra space in temporary folder ?


  3. @yogitha,

    A SQL Service is a service dedicated to running the SQL Server instance within a System.

    The service is part of the Windows Service mechanism. You can start and stop them,(Either Automatically,manually or delayed start).

    For example: The SQL Server default instance service, is named MSSQLServer(InstanceName) and ServiceName SQLServer(MSSQLServer).

    This particular service is meant for the DB Engine. There are other 3 optional services if installed,

    Analysis Services
    Reporting Services and
    Service Broker

    And of course, the most important of all, is the SQLBrowser service, without which, your SQL Server cannot be found on the network.



  4. Dear All

    whenver i am tried to open ssms (sql server managemnt studio) i got the massge window can not find “sqlwb.exe”
    please give me some solution


  5. Hello Zahid,

    Confirm the following:
    1. You are trying to connect to SQL Server 2005 SSMS.
    2. the file sqlwb.exe exists at path: %programfiles%\microsoft sql server\90\tools\binn\vsshell\common7\ide
    3. The above path is stored in the Environment Variable “Path”.

    Pinal Dave


    • Hi Pinal Dave,

      There is a ssmsee.exe file in the path where you mentioned (%programfiles%\microsoft sql server\90\tools\binn\vsshell\common7\ide) and I typed ssmsee in the Run command . SSMS is opened..


  6. Hello Pinal,

    i got an error when i m trying to open sql server managment studio express edition…the error says sqlwb- ssms has encountred a problem and needs to close.

    please help me..waiting for ur quick reply.Thanks


  7. Hello Pinal,

    My bat file works fine but the ‘Object explorer’ remains empty. Why is this not automatically filled with a list of all the databases on the machine?
    The pulldown box in the toolbar does correctly know the databases as located on the machine.

    Could you please help me out here?


  8. Hi, I need to install the Management studio for clients who dont have SQL server installed, I tried with EXpress its working fine, but they need to do import and export of data thats not possible with express.
    is there any other way to install the managment studio other then express edition, I have msdn and other licensed versions, but I dont want to install sql server for them.

    Please advice.


  9. Hi.. this is naveen, when i click on the Sql Server Management Studio, I unable to open the Sql Server and i Got the error message that, Windows is searchin for SqlWb.exe file to locate the file urself, click browse…. but how to solve this and i have to open it for my project.. plz help me


  10. hi
    i have one problem with sqlserver 2008
    whn os is not working how can i take back up from sqlserver is it possible
    i am waiting for ur reply


  11. Perfect, thanks. Do you use all MS products? My company used Microsoft applications until about 2002 and then moven to Linux. It took a few months to (2 years!) to settle and function to everyone’s needs but now it’s rock solid. Saved loads on licensing! Thanks, Way.


  12. This i have done . With Script file .. Opened the SQLWB.exe with credentials and Script file. Everything works fine .
    Instead of pressing F5 or Execute button . How can i pass the execute option through command prompt itself? I tried a lot still finger crossed for your replies now.


  13. Pingback: SQL SERVER – Weekly Series – Memory Lane – #049 | Journey to SQL Authority with Pinal Dave

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s