tcp\ip server tracking database changes - sql

I have a tcp\server ( .NET 3.5 ) that notifies connected clients about aah interesting events. These events occur because an aspx website is writing stuff to a database( SQL 2005 )
What would be a good way for this server to monitor the database so to speak
can the db push info to the server in any way?
any suggestions thoughts welcome
thanks

Take a look at SQL Broker Service - http://msdn.microsoft.com/en-us/library/ms345108(SQL.90).aspx.
To take this further you can use SqlDependency. There is a nice small article on CodeProject - http://www.codeproject.com/KB/database/chatter.aspx.
There are some caveats using it but many of them are already described on the web. Use the following resources:
http://www.wintellect.com/CS/blogs/jprosise/archive/2005/12/06/sqlcachedependency-hell.aspx
http://davidhayden.com/blog/dave/archive/2006/04/29/2929.aspx
SQL Broker services is quite vast to get in details with, but I hope I gave you good resources to start up with.

I had a similar problem. Needed instant notification of data insertion. I used SQL Broker Service and CLR stored procedure (written in C#). The procedure notify about the inserted data to another application using socket.
You can write similar CLR stored proc or CLR Trigger (Offcource asynchronous when using service broker)

Related

Is it possible to call a web service from SQL Server?

Is it somehow possible to call a web service from SQL Server without using CLR and get response immediatly back(not powershell, etc..)?
SQL Server provide a lot of different options to execute external scripts or connect to other devices. SQLCLR is one of the best but not the only option
From SQL 2016 you can use R or you can use Python, which let basically do what ever you want if you have permission.
You can use xp_cmdshell to execute commands
You can use OLE Automation objects (here is a nice sample).
You can use auditing tools (not recommended for most of these cases since these run in the background and not only when you need them), which allow you to execute external scripts on event
You can use simple QUEUE in the server side. In the Sp you can simply add message to the QUEUE and using external service app you can execute anything that you want once a new message get to the QUEUE. This option can be very useful since the execution is done asynchronous.
I can probably think about a lot more options... but let's start with these :-)

Which software/framework to use to create App for Call Calibration for Quality Dept

I'm not sure if this is the right place to ask this question. If not, please direct me to the right place.
We used to have an application that was created using VB and Microsoft Access. It was an application to score calls from Agents and would then run a few calculations and grade those agents based on a few algorithms.
We replicated all that Access data onto SQL but for some reason, we were just not able to connect the VB application to the SQL Database instead. The application was also outdated and we needed a change.
Can anyone suggest software/framework that can be used to create a new application with an ability to connect to a SQL database?
EDIT: We have a Microsoft Office 365 subscription. I was thinking of using PowerApps. I've never used it before. Does anyone think this could help serve my purpose?
I have extensive experience of using PowerApps to create applications connected to SQL Server (in my case Azure SQL Database), and am mostly satisfied.
There are some constraints, but not major. Please see these posts for some further information.
I would suggest PowerApps if you have Office365.

Accessing SQL Server 2005 from Silverlight 4?

If i am using Silverlight 4 and WCF to access my SQL Server 2005 DB - is it going to be a problem? Do i have to use SQL Server 2008 /R2 to do that - or will EVERYTHING work the same (i am making sure because irecall reading somewere that SL4 & RIA works only with SQL Server 2008/R2).
P.S
if you have a better way (a more direct way) to access SQL DB without the use of WCf(=RIA) it will be even better.
Because Silverlight is client-side, it uses only WCF to connect to data sources. That means that it really doesn't matter what version of SQL you are using relative to what version of Silverlight you have. The two are not connected directly. This allows Silverlight to do what it does best (display and gather data and do other UI "stuff").
WCF, on the other hand, can use almost any data source you can dream of using. It can pull from MySQL databases, SQL databases of all versions, and basically anything else that it can connect to via code.
RIA is built on top of WCF so there are some limitations on RIA. There is a question that goes through this in some more detail: RIA Services Vs. WCF and Shared Code
So, the simple answer to your question is no, using SQL 2005 will not be a problem and no, there isn't a more direct way to connect Silverlight to your SQL database.

send notification message to client

I have a table in server. I want to show a notification message in client when that table will update. How can i do that? excuse me because I'm beginner in SQL
you can use triggers for that.. here some notes for triggers
SQL triggers
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/sqlp/rbafysqltrig.htm
Introduction to SQL Triggers
http://www.mysqltutorial.org/sql-triggers.aspx
Usually, this kind of thing should not be done on the database layer, but on the application layer where the change is initiated.
The database server is not really equipped to do this. It doesn't have E-Mail capabilities, and it has no notification system like the kind you talk about.
How about SQL2008 Query Notification? This is something different than Notification Services which was removed in SQL 2008. Query Notification is basically creating SqlDependency Object in a client application with a SELECT Query and then the SQL 2008 server notifies when there was any change in THE query result. Here's some client side code example.
I have never used this myself but am looking for a very minimalistic intranet chat client based on SQL database.
Happy coding.

How to manipulate SQL Azure database through pure REST calls

I am an iPhone developer. For one of my clients I am supposed to access their database stored in SQL Azure.
I know that there is an Objective C SDK. I have downloaded it and ran the NetFilx example successfully. But of course my client's account is password protected. Also as of now the Objective C SDK seems to provide only read support. But I will need to write to the database too. So I guess that I will have to use REST based calls to update the database.
My problem is that I cannot figure out what will be the URL of the REST services for the SQL Azure Database and how the authentication will work. I tried searching the net but all the examples seems to show how to connect through .Net, Java or PHP (and other supported languages). Nobody seems to talk about pure REST calls.
I can successfully connect to the database using following command:
sqlcmd -UUsername#Server -PPassword -Stcp:server.database.windows.net -dDBName
If such is the connection command, can any of the Gurus out there help me figure out, what should be the URLs to access this DB through pure REST calls and how the authentication will take place.
Any help is greatly appreciated. Thanks in advance.
Pritam.
What you need is the OData interface to SQL Azure. Currently, SQL Azure only supports TDS protocal, which will require a library to use. However, if you put the OData interface in front of SQL Azure, you can call to SQL Azure via REST.
More information
http://www.odata.org/blog/got-sql-azure-then-youve-got-odata/