Showing posts with label event. Show all posts
Showing posts with label event. 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 Sql server using Javascript

Hi All,

I have a task need to update Sql server database whenever the user click "close" button in browser. It seemed I can't capture this event using asp.net. How can I access Sql server database in Javascript?
Thanks.

Quote:

Originally Posted by lindy

Hi All,

I have a task need to update Sql server database whenever the user click "close" button in browser. It seemed I can't capture this event using asp.net. How can I access Sql server database in Javascript?
Thanks.


Two Ideas for you:

1. Change your close button to use ASP.Net

2. Use AJAX to call a page that will update your information.

Thursday, February 16, 2012

Access Logs

Hi all,
In our win2k3 event viewer there are hundreds of failed logon attempts
for our SQL Server. Unfortunately, this log doesn't supply any
connection specific information which is what we need. Are there any
other logs that MSSQL 2000 keeps on it's own? I want to keep a record
of these attempts just in case something does happen we maybe will have
something to go on. Thanks!
--
Regards,
TroyHi,
It will be there in SQL Server Error logs as well. The location of the files
will be in \Program files\Microsoft sql server\server name\Log directory.
or you can execute XP_READERRORLOG from query analyzer .
Thanks
Hari
MCDBA
"Troy" <poster@.designguide.com> wrote in message
news:MPG.1a9d757e7936be5a98968e@.msnews.microsoft.com...
> Hi all,
> In our win2k3 event viewer there are hundreds of failed logon attempts
> for our SQL Server. Unfortunately, this log doesn't supply any
> connection specific information which is what we need. Are there any
> other logs that MSSQL 2000 keeps on it's own? I want to keep a record
> of these attempts just in case something does happen we maybe will have
> something to go on. Thanks!
> --
> --
> Regards,
> Troy