If I did not want to create SqlConnection and SqlCommand objects etc etc but instead wanted to use only System.Net.WebClient (or some other "essentially plain text" communication) to talk to a SQL Server 2005 or above database, how would I go about connecting, issuing commands and receiving result sets?
I'm assuming I'll need to do a lot of parsing of data to get the structure I'm used to, but how would you go about a "bare-bones" SQL connection?
I recommend you go over Creating an OData API for StackOverflow including XML and JSON in 30 minutes to get a feel of how to add an OData layer to your application.
SqlClient (ie. SqlConnection and SqlCommand) is the bare-bones SQL connection objects. They're the lowest API that offers access to the TDS connections and there is nothing lower than that. Anything bellow this level would mean you'd have to write your own TDS implementation.
There is an alternative way of communicating with SQL Server, namely via HTTP SOAP services, see Overview of Native XML Web Services for Microsoft SQL Server 2005. However, this is
a deprecated feature and it doesn't give you any advantage.
If you want your client to communicate via plain HTTP with a SQL Server, you should place a web service layer to act as a communication mid-tier. Your client would talk to this layer using SOAP or REST, and this layer would talk to SQL in turn using TDS. Luckly there is a way to achieve this with just a few lines of code and a couple of clicks, by deploying an OData service.
Related
Is it possible to access database object using HTTP in SQL Server 2012 the way it was done using SQL Server 2000?
I referred following article but it is about SQL Server 2000.
Accessing Database Objects Using HTTP
I want to access the database object in following manner
http://iisserver(my machine ip)/nwind/dbobject/Test4[#Id='1']/#x
As shown in the article http://technet.microsoft.com/en-us/library/cc646023.aspx#BKMK_ssde, the SQL server can be configured to be accessed via HTTP. To achieve this you firstly need to create and endpoint (as described here). Among this, the firewall issue is also need to be checked because of the additional ports usage. But, according to this article, the HTTP endpoints will not be supported in the future versions of SQL Server.
In our development team we have:
4 developers
one application uses PHP and database Microsoft SQL Server 2008r2, except one using PowerBuilder instead of PHP and one using MySql instead of Microsoft SQL Server
All applications are database-centered, some of them are for general public, some are not.
Question is: for the procedures and functions shared by all applications, what does it make most sense to use, database procedures/functions or web services?
We could not find an agreement within the team.
Whatever you answer, please explain the reasons.
Webservices and Database Proc/Functions are two entirely different things.
Webservices are the services over the web, mainly used when a client and a server interact and client interacts with the server through web or HTTP or any other protocol.
Database proc/func - are created to interact with a login to a DB server.
In your case, if all the application are in the same domain... then you dont need to access through webservices and also it is a lot of overhead.
You can create a common DB server , where you can keep these proc/func and can be consumed by all.
I am freelancing to a game server company and this game server uses a dedicated server with SQL Server 2008 on it, the game client connect to the game server on a random port (not a problem) and the SQL Server is closed down on the dedicated server, so it can't be accessed from a external source.
I am working on an idea to sell to my manager to create a web service, so I could make an online registration form and control panel to people to manage their goods online (without the game).
Well the question is: what's the best way to make a web service (the port 80 is open and with iis7/windows server 2008) to work on SQL Server 2008 Express, providing XML with some info to my Control Panel, and to make the online form to send a request to create new players on SQL Server too and answer with a XML confirming it?
I know I could do on PHP (since this IIS7 has php installed on it), but that would be a hell of work, and if there is no other way I will be doing it manually on php.
I would like to know if there is some way to work with something like NuSoap to work with SQL Server or any other way that is not the NATIVE SQL Server, (that I just read on microsoft website that is deprecated). And how to do it if possible
Thanks in advance
Create an OData service using WCF over an EF model of your game database. Read here: Creating an OData API for StackOverflow including XML and JSON in 30 minutes
Do any of the existing open source databases have the ability to expose a database as a web service on a server port? I'm looking for something like Microsoft SQL Servers ability to expose a wsdl web service URL .
If not, I guess i will use SQL Server Developer Edition...
CouchDb is built around HTTP, with all actions being http methods. This makes the database easy to access from a variety of platforms and languages.
However, you can create a web server for any databases, for the given app with varying degrees of flexibility.
You can do it with any database connected to a JBI like openEsb if you use a binding component like DatabaseBC
this is a good screencast on how generating a WSDL from an SQL file ... for more details you can look at this tutorial ...
I need to transfer data daily from SQL Server (2008) to SQL Server (2005). One of the servers is located at our web host so the data will be transferred over the Internet. On the same network I would use SSIS to transfer the data, but over the Internet this is not a secure option. Is there a secure way of achieving this?
You can use SSL with SQL Server (2000/2005 Instructions / 2008 Instructions) and then force protocol encryption on the connection between both machines. You don't have to use a purchased SSL certificate either, you can use Windows Server Certificate Services to generate one - however if you do so then the CRL must be on a machine that both servers can connect to. An easy way to do this is install Certificate Services on a stand alone machine, perhaps just a VM and the configure it to embed a public DNS name for it's CRL. This doesn't have to be a machine running Certificate Services, just something you own and can upload to. Then you can generate the certificates and publish the CRL and tada, all done.
You will need to ensure the service account SQL is running as has access to the private key of the certificate it is using.
Generally it isn't recommended to have your SQL Servers exposed to the Internet, although that may be out of your control in this case. In your position I would investigate developing some separate Web Services that would perform the transfer of the data. These can then be secured using a variety of methods, such as SSL and WS-Security and other custom user permissions. If that isn't possible then blowdart's answer seems like the way to go.
You can use Service Broker:
Built into SLQ Server engine itself, no need for external process to drive communication.
Compatible protocol SQL 2005 and SQL 2008 communicate over Service Broker out-of-the box.
No need to expose either server to the internet. Through Message Forwarding you can expose
just a SQL Express, with no data on it, to the internet to act as a gateway that lets messages into the back end target.
Communication is encrypted.
Speed, the sample in the link shows how you can exchange over 5000 1k payload messages per second between commodity machines.
Unlike SSIS or replication Service Broker is a general communication framework so it won't provide support to extract the changes and to apply the changes, with conflict resolution and the like. You would have to code that part yourself.