Hyperlink value in SQL Server query results in SSMS

I am trying to create something for our QA users, where the query they will run will return a column with hyperlinks. I am using SQL Server 2008 R2 and SSMS.

How will I link to a hyperlink in SSMS so that the linked value opens in the browser?

The idea is that a Qa person can simply click the link and the corresponding ASP.Net application will open in a browser window.

The query looks like the one below, which now displays a row that is not associated with a section in the DocLink column.

SELECT DocNumber, 'https://www.xyz.com/mypage.aspx?docNumber=' + CAST(DocNumber AS varchar(20)) AS DocLink FROM Docs 
+6
source share
2 answers

Passing the result string as XML:

 SELECT CAST('https://www.xyz.com/mypage.aspx?docNumber=100' AS XML) 
0
source

I have not found a way to open the URL directly from the results SSMS , but if you want to get an open hyperlink from SSMS stick to the following.

Step 1. Bring the result in XML. those.

 SELECT CAST('http://www.google.com' AS XML) Google 

Step 2. After executing the query in the results window, click on the hyperlink. This will open another tab in SSMS.

enter image description here

enter image description here

Step 3. On this new tab, right-click on the link and select the Open URL option. A link will open in your default browser.

enter image description here

Try this.

0
source

Source: https://habr.com/ru/post/1502442/


All Articles