How to create shortcut for SSMS and Connect to Default SQL Server Automatically - SQ: Server / TSQL Tutorial Part 4

Scenario:

You are working as SQL Server Developer with Car Insurance company as contractor. They have provided you name of SQL Server Instance and Database Name you will be working during your assignment. Every time you open SQL Server Management Studio, you have to provide Server Name and then choose Database Name to start work. You would like to create s shortcut for SSMS with default settings so you can connect to Database with one click.


Solution:

Step 1:  Create SSMS Shortcut. 
Go to Search and type SSMS. Once see the SSMS, Right Click and choose Open file location.

How to create SSMS Shortcut - SQL Server Tutorial

One you choose Create Shortcut, it will ask you Do you want to create on Desktop. Click that and you are done.

How to create SSMS Shortcut - SQL Server Tutorial

Step 2: Change Shortcut Properties
As our shortcut is ready now. Go to Desktop and right click on SSMS Shortcut and then go to properties.


In Target, we are going to add some parameters to SSMS.exe. By default it is simply opening SSMS.exe. 
If I would like to open my default SQL Server Instance with Windows Authentication and user Database TestDB1, i can use below parameters

-s .  -E -d TestDB1

Parameter meansings
-s The name of the SQL Server Instance to connect to (after -s, I provided Dot(.) that means I would like to connect to my default SQL server Instance. I could have provided Named SQL Server Instance if want to.

-E User Windows Authentication to login to SQL Server.

If you would like to use User Name and password, you can use -U for user name and -P for password.

-d The name of the SQL Server Database to connect to.


How to connect to SQL Server with Single Click- SSMS Shortcut - SQL Server Tutorial

Hit apply. Now once you will open SSMS by using Shortcut, it will automatically connect to default SQL Server Instance and open Query with scope of TestDB1.



6 comments:

  1. You are working as SQL Server Developer with Car Insurance company as contractor. They have provided you name of SQL Server Instance and Database Name you will be working during your assignment.
    desktop gaming pc deals

    ReplyDelete
  2. Thank you very much for sharing an amazing guide along with the video Tutorial. Currently I have Lenovo IdeaPad 3 14ADA05 and I will practice again and again on it so that I could manage it.

    ReplyDelete
  3. thanks for sharing such a great info. its really helpful Christmas Deals for Gaming in Uk

    ReplyDelete
  4. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    EMAIL MARKETING

    ReplyDelete
  5. Wow awesome blog post. Really thank you! Fantastic. stacked dies

    ReplyDelete