locked
How to Call a URL from T-SQl RRS feed

  • Question

  • Hello all,

    Is there any method to call a URL for eg: http://www.google.com

    from SSMS using T-SQL and the website should open in any browser installed in the local system

    Is this possible, if yes then how

    Thanks in advance...


    Pankaj Kumar Yadav-

    Tuesday, August 21, 2012 1:05 PM

Answers

  • Ctrl + Click to follow the link in SSMS.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    • Marked as answer by Pankaj067 Wednesday, August 22, 2012 10:05 AM
    Tuesday, August 21, 2012 2:08 PM
  • If you are asking how to invoke a URL from T-SQL to display in a browser, I am afraid that you display that you have not understood the architecture of SQL Server.

    SQL Server runs as a service. A service has no desktop and cannot interact with browsers. Furthermore, in a production system, SQL Server typically runs on a different machine that the end user connects from. SQL Server cannot control the user's machine.

    What you may want to do is to connect to a web service to retrieve data or for that matter update, for instance to make a booking. This you can do in SQL Server through a CLR stored procedure. But it is something to be careful with, or at least if you do it in a transaction.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Janos BerkeMVP Tuesday, August 21, 2012 7:27 PM
    • Marked as answer by Pankaj067 Wednesday, August 22, 2012 10:05 AM
    Tuesday, August 21, 2012 2:45 PM

All replies

  • As long as you type the exact URL with http in the comments, it seems to work (SQL Server 2012).

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    • Edited by Naomi N Tuesday, August 21, 2012 1:19 PM
    Tuesday, August 21, 2012 1:18 PM
  • So what would be the syntax for accessing the URL?

    Pankaj Kumar Yadav-

    Tuesday, August 21, 2012 1:32 PM
  • Hi,

    There is no such a t-sql command to open a website from SSMS. you need to click on it as in Naomi's answer.

    Janos


    There are 10 type of people. Those who understand binary and those who do not.

    My Blog | Hire Me

    Tuesday, August 21, 2012 1:43 PM
  • Ctrl + Click to follow the link in SSMS.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    • Marked as answer by Pankaj067 Wednesday, August 22, 2012 10:05 AM
    Tuesday, August 21, 2012 2:08 PM
  • If you are asking how to invoke a URL from T-SQL to display in a browser, I am afraid that you display that you have not understood the architecture of SQL Server.

    SQL Server runs as a service. A service has no desktop and cannot interact with browsers. Furthermore, in a production system, SQL Server typically runs on a different machine that the end user connects from. SQL Server cannot control the user's machine.

    What you may want to do is to connect to a web service to retrieve data or for that matter update, for instance to make a booking. This you can do in SQL Server through a CLR stored procedure. But it is something to be careful with, or at least if you do it in a transaction.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Janos BerkeMVP Tuesday, August 21, 2012 7:27 PM
    • Marked as answer by Pankaj067 Wednesday, August 22, 2012 10:05 AM
    Tuesday, August 21, 2012 2:45 PM
  • Thanks to all for your effort.


    Pankaj Kumar Yadav-

    Wednesday, August 22, 2012 10:06 AM