Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Tuesday, March 27, 2012

Accessing Initiating Event + Data From Existing External DB

Hello,
I have been exploring NS and I would like to use it as a rudimentary transfer tool. I have an existing database table from where I would to transfer a record to subscribers and then possibly move the records out of that table.

1. How do I set up the ..\SubscriptionClasses\SubscriptionClass\EventRules\EventRule so that it reads from another database? The TSQL Statement should probably work accross databases?

2. As I scroll through the sample ADFs I would think that ..\Providers\HostedProvider should also change too to another type.

Thank you very much,

Lubomir

Hi Lubomir -

Using the SQL Server Event Provider, you can collect events from tables in other databases or even other instances of SQL Server.

Configure the HostedProvider node to use the SQL Server Event Provider. Use the EventsQuery element to enter the T-SQL code that you will use to recognize new rows (or events of interest) in the table. Here's a sample.

<HostedProvider>
<ProviderName>SqlPrEP</ProviderName>
<ClassName>SQLProvider</ClassName>
<SystemName>%_NSSystem_%</SystemName>
<Schedule>
<Interval>P0DT00H00M60S</Interval>
</Schedule>
<Arguments>
<Argument>
<Name>EventsQuery</Name>
<Value>SELECT rowId, col1, col2, col3 FROM AnotherDb.dbo.vwCurrentRows WHERE rowId NOT IN (SELECT rowId FROM MyChron)</Value>
</Argument>
<Argument>
<Name>EventClassName</Name>
<Value>PressRelease</Value>
</Argument>
</Arguments>
</HostedProvider>

Next you can use the EventRule node of the SubscriptionClass to define your match rule; that is to write the T-SQL code that matches the events that you've collected to those subscribers who are interested in your events.

You EventRule would look something like this.

<EventRule>
<EventClassName>PressRelease</EventClassName>
<RuleName>PrEventRule</RuleName>
<Action>
INSERT INTO PrNotifications(
SubscriberId,
DeviceName,
SubscriberLocale,
col1,
col2)
SELECT
s.SubscriberId,
s.SubscriberDeviceName,
s.SubscriberLocale,
e.col1,
e.col2
FROM
PressRelease e,
PrSubscription s
WHERE
e.col3 = s.col3
</Action>
<ActionTimeout>P0DT00H00M45S</ActionTimeout>
</EventRule>

HTH...

Joe

Tuesday, March 6, 2012

Access tables transferred to SQL Server are set to "read only." How do I correct/

I created an Access project and transferred some tables from my .mdb Access
database into an existing SQL Server database. Now, the tables are "read
only" meaning that I can't add/modify/delete data in the tables. But, when
I open the same SQL Server database, from the same desktop, using EM I can
add/modify/delete data in the SAME table.
Where should I look?
TIA,
Larry WoodsCreate a primary key/unique index on the tables in question. Access
refuses to update SQLS tables otherwise.
--Mary
On Wed, 28 Jul 2004 07:18:35 -0700, "Larry Woods"
<larry@.NOSPAMlwoods.com> wrote:
>I created an Access project and transferred some tables from my .mdb Access
>database into an existing SQL Server database. Now, the tables are "read
>only" meaning that I can't add/modify/delete data in the tables. But, when
>I open the same SQL Server database, from the same desktop, using EM I can
>add/modify/delete data in the SAME table.
>Where should I look?
>TIA,
>Larry Woods
>

Access tables transferred to SQL Server are set to "read only." How do I correc

I created an Access project and transferred some tables from my .mdb Access
database into an existing SQL Server database. Now, the tables are "read
only" meaning that I can't add/modify/delete data in the tables. But, when
I open the same SQL Server database, from the same desktop, using EM I can
add/modify/delete data in the SAME table.
Where should I look?
TIA,
Larry Woods
Create a primary key/unique index on the tables in question. Access
refuses to update SQLS tables otherwise.
--Mary
On Wed, 28 Jul 2004 07:18:35 -0700, "Larry Woods"
<larry@.NOSPAMlwoods.com> wrote:

>I created an Access project and transferred some tables from my .mdb Access
>database into an existing SQL Server database. Now, the tables are "read
>only" meaning that I can't add/modify/delete data in the tables. But, when
>I open the same SQL Server database, from the same desktop, using EM I can
>add/modify/delete data in the SAME table.
>Where should I look?
>TIA,
>Larry Woods
>

Access tables transferred to SQL Server are set to "read only." How do I co

I created an Access project and transferred some tables from my .mdb Access
database into an existing SQL Server database. Now, the tables are "read
only" meaning that I can't add/modify/delete data in the tables. But, when
I open the same SQL Server database, from the same desktop, using EM I can
add/modify/delete data in the SAME table.
Where should I look?
TIA,
Larry WoodsCreate a primary key/unique index on the tables in question. Access
refuses to update SQLS tables otherwise.
--Mary
On Wed, 28 Jul 2004 07:18:35 -0700, "Larry Woods"
<larry@.NOSPAMlwoods.com> wrote:

>I created an Access project and transferred some tables from my .mdb Access
>database into an existing SQL Server database. Now, the tables are "read
>only" meaning that I can't add/modify/delete data in the tables. But, when
>I open the same SQL Server database, from the same desktop, using EM I can
>add/modify/delete data in the SAME table.
>Where should I look?
>TIA,
>Larry Woods
>