Web Services are getting more and more popular these days. SQL Server 2005 provides an excellent set of features to expose stored procedures as web services. Following is a quick and easy way to implement a stored procedure as a web service. It is just an example but gives you a clear idea how to use SQL Server 2005 for web service implementation:
Set ANSI_NULLS ON
Set QUOTED_IDENTIFIER ON
go
—Sample STored procedure to retrieve Server Date and Time
Create Proc usp_GetServerTime
as
Select GetDate()
—Creating Web Service
CREATE ENDPOINT [EP_GetServerTime]
STATE=STARTED
AS HTTP
(
PATH=‘/URL_GetServerTime’,
PORTS = (CLEAR),
AUTHENTICATION = (INTEGRATED),
SITE=‘DBSERVER’
)
FOR SOAP
(
WEBMETHOD ‘GetServerTime’
(
NAME=‘TestDB.dbo.usp_GetServerTime’
),
WSDL=DEFAULT,
DATABASE=‘TestDB’,
NAMESPACE=DEFAULT
)
For details on web service support in SQL Server 2005, please visit
http://www.developer.com/db/article.php/3390241