Cannot insert the value NULL into column 'NotificationBatchId'

Using Yukon Apr 05 CTP

Have defined the custom fields for the subscription (like the Stock Name and Stock Price)
Error while the SubscriptionsEventRule gets executed
the NSFireDeveloperDefined1 stored proc (that contains the SubscriptionsEventRule t-sql) throws up this error

"Cannot insert the value NULL into column 'NotificationBatchId' "

This columns belongs to the NSTestNotifications table.
Should this column be a bigint "identity" column?

Why this error? The rule need not insert values for this col, isn't it?

Rgds

[549 byte] By [mat_net] at [2008-1-21]
# 1
Figured out the problem

If the actual table name is used in the insert statement in the SubscriptionsEventRule instead of the <NotificationClassName>, then this error comes up.

mat_net at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Notification Services...
# 2
Glad you found the error. You should always insert into the views (with the same name as the notification classes) rather than into the tables directly.
Thanks
-shyam
ShyamPather at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Notification Services...
# 3
I had the same problem, the reason is that you are using the wrong table/NotificationClassName:

The name in the NotificationClass Element is actually a View and you should use the exaxt name you are defining in there in your SQL Statement for the EventRule Action Element in the SubscriptionClass.

<NotificationClassName>myThing</NotificationClassName>
will create the "myThinkNotifications" Table in the database.

Do not use "myThingNotifications" to insert the data but use myThing istead!!!

you have to use:
<SubscriptionClass>
<EventRules>
<EventRule>
<Action>
insert into myThing...
</Action>
</EventRule>
</EventRules>
</SubscriptionClass>

This did the trick for me an now it is running!

God bless and put you trust in Jesus

Ralf
Ralf at 2008-2-6 > top of Msdn Tech,SQL Server,SQL Server Notification Services...

SQL Server

Site Classified