Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all,

I am using sql dependency to get notifications from sql server, also using signalR for sending notifications to all active clients.

I have already achieved the results as expected but now I need to use a complex select query instead of a simple statement.

What I have tried:

Here is query I used


SELECT a,b,c,d FROM DBO.TABLEA

But now I need to use something like this


SELECT MAX(a) Price, b,c
FROM DBO.TABLEA EAB
INNER JOIN DBO.TABLEB ECM ON EAB.ID = ECM.ID
WHERE EAB.OI = @OI -- Some Variable
GROUP BY ECM.b,ECM.c
ORDER BY MAX(a) DESC


Which does not allow me to get notifications.

I used one another scenario to do so but I feel it is not a correct way.

Created a job in sql server, that job hits a procedure in a fixed interval and filters records from table TABLEA and inserts those records to a new table TABLEC. Now I can use that new table TABLEC for interacting with C# code for notification. (It is working fine but I can not create new tables for each type of different notifications.)

Looking forward for everyone's valuable response.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900