none
sqlclr stored procedure to call an api

    Question

  • I am working on making a call from sql server to pass the address or zip in order to get the Latitude & Longitude for that location. To accomplish this task I may have to write sqlclr procedure which is something I have never done. How do I approach this to accomplish my task.

    Thanks in advance..........

    Tuesday, November 01, 2011 6:57 PM

Answers

All replies

  • If you have the right edition of Visual Studio (Workgroup or Enterprise edition, I think), you have database projects. Here's a walkthrough. http://msdn.microsoft.com/en-us/library/dd193408(v=VS.90).aspx.

    If you don't have that version, start here: http://msdn.microsoft.com/en-us/library/ms131052.aspx. You can also build these in Visual Studio as "Class Library" projects, you'll need to supply your own DDL to catalog the assembly and procedure.

    Cheers, Bob

    • Marked as answer by KJian_ Wednesday, November 09, 2011 7:26 AM
    Tuesday, November 01, 2011 7:31 PM
    Moderator
  • In addition, there are sample geocoder projects on CodePlex. Either search for "Geocode" on Codeplex (there are a few), or start with this sample SQLCLR one: http://yaddressudf.codeplex.com/

    Cheers, Bob

    Tuesday, November 01, 2011 7:33 PM
    Moderator
  • Thanks very much for your response Bob. I am using VS 2010 Professional Edition. Can I call an api in sql server using any of the system stored procedures or extended stored procedures?
     
    • Edited by ione721 Tuesday, November 01, 2011 11:25 PM incomplete
    Tuesday, November 01, 2011 9:00 PM
  • I don't know what you mean by "call an API in SQL Server". You can write a SQLCLR stored procedure to call whatever .NET-based API you'd like, subject to the limitations and rules in the Books Online.

    Cheers, Bob


    Wednesday, November 02, 2011 10:18 PM
    Moderator