Changenotifications not working on some tables

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
OlliWW
Posts: 17
Joined: Mon 25 Mar 2013 17:03

Changenotifications not working on some tables

Post by OlliWW » Thu 18 Jul 2019 13:15

Hi,

I'm currently playing with change notifications in SDAC.

My Database consits of two example tables. I do very simple change notification - queries, like:
select <primary key> from dbo.mytable

With table1 everything works fine. On table2 (on the same database) my changenotification fires on open:
'SELECT statement does not meet the requirements for query notification'
What requierements are exactly meant?

Edit:
Some more information: When i try this on a table which is not working it imediatly fires a query notification of the type "query"

Stellar
Devart Team
Posts: 332
Joined: Tue 03 Oct 2017 11:00

Re: Changenotifications not working on some tables

Post by Stellar » Fri 19 Jul 2019 07:36

The requirements for SELECT statements for compatibility with Query notifications are descirbed in this article on MSDN:
https://docs.microsoft.com/en-us/previo ... v=sql.105)

Also, you can find more details on TMSChangeNotification here:
https://www.devart.com/sdac/docs/devart ... cation.htm

OlliWW
Posts: 17
Joined: Mon 25 Mar 2013 17:03

Re: Changenotifications not working on some tables

Post by OlliWW » Fri 19 Jul 2019 07:58

Hi Stellar,

Thank you for your response. I had already knowlage over that microsoft link.

My Query is always the same:

select primary_key from table

very simple. That works for one table but not for the other table on the same database.

On the not working table i get the result before the error. and it fires a (invalid) query notification (type: query).

Here is a link what it looks like:
https://imgur.com/vHwoSxo

Stellar
Devart Team
Posts: 332
Joined: Tue 03 Oct 2017 11:00

Re: Changenotifications not working on some tables

Post by Stellar » Fri 19 Jul 2019 14:42

As described in the reference, table names must be qualified with two-part names. Try to add the schema name to the table name, e.g.

Code: Select all

select primary_key from dbo.Table_name

OlliWW
Posts: 17
Joined: Mon 25 Mar 2013 17:03

Re: Changenotifications not working on some tables

Post by OlliWW » Fri 19 Jul 2019 14:49

Hi Stellar,

I've found the problem:
Some of my tables contianed a computed column - which is not allowed.

Stellar
Devart Team
Posts: 332
Joined: Tue 03 Oct 2017 11:00

Re: Changenotifications not working on some tables

Post by Stellar » Fri 19 Jul 2019 14:54

Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.

Post Reply