#0220-SQL Server-Enable single-click URL navigation


There are many productivity improving and usability tips and tricks related to the SQL Server Management Studio (SSMS). Ever since I started my blog (about 2 years ago), I have been writing mostly about these tips, and the list never ends! In today’s post, I will show how to configure the SSMS to recognize URLs within code comments.


One may place URLs in code comments for many reasons. Those that are applicable for me are:



  • Referencing a specification
  • Referencing a code defect/enhancement: The URL would point to the related TFS defect
  • A link to Sharepoint or any collaboration tool that development teams may be using
  • A link/citation to a website/blog that has been used as reference

For most languages & file extensions that the SSMS can handle, using Ctrl+click on any hyperlink opens the built-in web-browser and launches the associated page within SSMS. [One difference between SSMS for SQL 2012 and SQL 2008 is that the SSMS for SQL 2008 does not show the hyperlink in blue/underline].


Image showing single-click URL navigation, where using Ctrl+click over a hyperlink will launch the link in a browser.


The SSMS for SQL Server 2012 and below (tested for SQL Server 2008 and SQL 2008 R2), provide a text editor option – “Enable single-click URL navigation” that allows the user to control this behaviour. To access this option, go to Tools –> Options –> Text Editor –> All languages –> General (one can do this for specific languages too).


Options->Text Editor)” src=”http://media.beyondrelational.com/images.ashx?id=2e1b88231cf24e9c91c41ca0192eb778&w=-1&h=-1″ width=468 height=275>


Un-checking this option will cause SSMS to stop recognizing hyperlinks within code comments:


Options causes SSMS to stop recognizing hyperlinks.’ src=”http://media.beyondrelational.com/images.ashx?id=600b25791c0948408aec09821a2834b9&w=-1&h=-1″ width=510 height=148>


The benefit of keeping “Enable single-click URL navigation” checked is that when developing and reviewing T-SQL code, it becomes very easy to reference and reach out to related documentation. I trust you found this feature useful.


Until we meet next time,


Be courteous. Drive responsibly.

Advertisements

Let me know what you think about this post by leaving your feedback here!

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