Showing posts with label notification. Show all posts
Showing posts with label notification. Show all posts

Tuesday, 20 March 2012

Connect to an NS instance on remote server

I have Sql Server 2005 and Notification Services on one machine and I am developing a web app on another machine that will be front-end to the NS instance. So far all the examples I've seen for connecting to an instance using NS API assume that Sql Server, Notification Services and the development environment are on the same machine. Is it possible to connect to an instance on a remote machine using NS API? If so, how can it be done?

On the machine hosting your web app, you'll need to register the NS instance. When you register instance, you specify the name of the database server hosting the NS instance and the sql username/password used to connect to it, if you're using sql auth. Once you've created the registration, you can then use the NS API just like you would if the sql server were local: you create an instance of the NSInstance class, passing the instance name. The NSInstance implementation will read the server/connection information from the registry.

To register the instance, you have two options:
- On the web server machine, run nscontrol register, passing the name of your SQL Server (not the local machine) to the -server parameter.
- On the web server machine, run SQL Server Management Studio, connect the Object Explorer to the SQL Server hosting your instance's databases, right click on the instance name in the Notification Services folder and choose "Register" from the context menu.

Whichever tool you choose (nscontrol or management studio), you must run it locally on the web server box.
Hope this helps.
-shyam

|||Shyam is right that you need to register the instance.

There is also a third option to do the registration:
- You can use the Microsoft.SqlServer.Management.Nmo.Instance.RegisterLocal method to do the registration at runtime. There are class and instance based overloads that you can choose from to meet your needs. As the name suggests, you have to execute it on the locally on the web server box.

Whether you choose to do your registration at runtime or as part of your deployment steps (using the options Shyam mentions) you have to do it before you initialize the NSInstance object.

Hope that helps.
Anand

Friday, 24 February 2012

Conflict Resolution: Is defining local subscription enough: How to get log of lost record.

Publisher always wins is the default, so you don't need
to do anything to achieve this.
To get notification of a conflict, you could create a
polling routine (there's no alert that I know of).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
hi Paul,
Thanks for you reply, I have few more queries
1. Where is this conflict information specially the losing row information is stored, at the publisher side or at the subscriber side? if losing row information is maintained at the publisher side is there any way so that we can store this information at the publisher side.
2. As you talked about creating a polling routine to get notification of conflict, in my implementation I just want a log file which contain information about the losing row nothing else, will the polling routine you are referring to can do the same and alsoI have not much information about how to write polling routine can you throw some light on it?
regards.
Ruchir.

Quote:

Originally posted by Paul Ibison
Publisher always wins is the default, so you don't need
to do anything to achieve this.
To get notification of a conflict, you could create a
polling routine (there's no alert that I know of).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

|||Have a look at the tables
conflict_<PublicationName>_<ArticleName>_usertable name
and
MSmerge_delete_conflicts
at the publisher.
The polling routine would be not much more than a job
that runs regularly and does a select from this table,
then sends the results in an email as an attachment. The
origin_datasource column could be used to determine the
correct recipient.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Conflict Resolution

Is it possible to have a message or notification if/when conflicts occur?
Is this art of any standard resolver or does this require a custom resolver
to be created?
TIA
Tony S.
Tony,
you could use a custom resolver or regularly poll the conflict table.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul
Tony S.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23dijkUCxFHA.2212@.TK2MSFTNGP15.phx.gbl...
> Tony,
> you could use a custom resolver or regularly poll the conflict table.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Hi Paul,
Is there only one conflict table or one conflict table per db table ?
Is the conflict table stored in the SQLCE db or only at the SQL2000 DB ?
Thank you for your time
Panayotis
Paul Ibison wrote:
> Tony,
> you could use a custom resolver or regularly poll the conflict table.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Panos,
there'll be one per table in the format:
conflict_<PublicationName>_<ArticleName>_usertable name
These tables are stored at the publisher.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Friday, 17 February 2012

Configuring SQLAgent for sending email

Hi All,

I need some help in configure our SQL 2K & 2K5 servers to send notification on job failers. Have created operators on SQL 2k but when i try to do a test mail it fails saying mai session is not running. I go to properties of the Sql agent to turn on mail session but it is grayed out. Can someone please direct me to the steps I need to take when setting up sql server with email capability. Do I have to install office (outlook on the sql server box) in order for emailing to work?

Thanks in advance for your help.

Nats

On SQL 2000 servers, you will need a MAPI client installed (e.g., Outlook).

However, I recommend checking out the usage of xp_smtp_sendmail -an alternative to installing Outlook and all of its issues.

Mail –Sending
SQL 2000 - http://www.sqldev.net/xp/xpsmtp.htm
http://www.aspfaq.com/show.asp?id=2403