Generate REST API from SQL Server database - sql-server

Is it possible to generate a REST API from an existing SQL Server database?
I'm using Visual Studio and SQL Server on Azure.
How would I do this?

There is no direct way to do this. But you can achieve in two ways
(i) Using external applications like DreamFactory
(ii) Write your own code to interact with SQL using c# with any entity framework, or even using javascript language

Related

SQL Tables without SQL Server or Express

This question is directed at developers that use database tables in their applications.
Is it possible to create/develop an application that uses a table that was created in SQL Server or SQL Server Express, without having either of those applications installed on the users system/device?
Its depends which type of connection string you have if its local so you need to download and if its not local you can use
Seems like you're looking for SQLite. This approach uses the filesystem to store data that we can access using standard SQL queries. It requires no additional applications to be installed.

Oracle REST Data Service (ORDS) equivalent in SQL Server

I've started using Oracle REST Data Services (ORDS) for a few projects. This is a middleware tier java app that simply allows access to Oracle Database objects via REST. The objects you can "restify" are things like tables, packages, procedures, views, etc. I'm curious if there is an equivalent native (or first party) feature in Microsoft SQL Server?
Thanks.

Connect to a webservice from SQL

SQL Server is able to open excel sheets (xlsx), access databases (mdb) and other data streams using data providers (e.g. JET, ACE) and OPENROWSET.
Are there similar facilities to extract data from a remote webservice ? Using OPENROWSET and providing it a web service driver and URL and some schema definition to translate the hierarchical nature of the webservice XML output into a table that SQL Server can query on.
I'm thinking of something like:
select * from
OPENROWSET('WEBSERVICE.4.0.PROVIDER','http://mydomain/webservice.asmx')
That's a high level question, although I know it's conceptually possible, I'd like to know if there are any implementations of this idea.
Thanks
You could use a SQL-CLR assembly (in versions 2005 or newer) to handle the calling of the stored procedure, and to insert the data into your SQL Server database table.
See some of these tutorials (plenty more when you Google or Bing for it):
CLR Stored Procedure Calling External Web Service - SQL Server 2005 Tutorials
Consuming a Web Service from a SQL Server 2005 CLR Assembly
Query a web service with SQLCLR
Invoking a Web Service from a SQLCLR Stored Procedure
Calling a Web Service from within SQL Server
How to consume a web service from within SQL Server using SQL CLR

call a web service from T-SQL in Sql Server 2008

Is there a way to call a HTTP web service from T-SQL (no SQLCLR) in Sql Server 2008? I just need to send information out, I do not need to receive anything into T-SQL.
Thanks.
You can automate the XMLHTTP server object using the Object Automation extended stored procedures.
Example here
I suggest you use the CLR or an SSIS package though.
If you are doing this in a sproc, then you could create a tiny VB program and use
exec sp_cmdshell 'c:\path\myapp.exe'
to call your program. Technically its not CLR embedded in SQL Server right? :)
The Web Service Task should allow you to do that.
Web Service Task
How to: Call a Web Service by Using the Web Service Task (SQL Server Video)
I'm assuming you are doing this from an "intergration services" package

How do I add my SQL Server 2005 database to my VS MVC 2 project?

I want to use the built-in membership functionality that comes with the SQL Server Express database that is created when the project is built but I want to use it in my SQL Server database without having to re-create the wheel so to speak.
Take a look at Setting up SQL Server with ASP.NET MVC it shows you all that you need
Yes, you can, what you need do is run aspnet_regsql against your own database, it will add all the database objects into your database.

Resources