Friday, March 30, 2012
query about publisher or subscriber
a subscriber in a replication environment?
Darin
*** Sent via Developersdex http://www.codecomments.com ***
Hi Darin,
In your Publication database...
select subscriber_type, subscriber_server
from sysmergesubscriptions
order by subscriber_type, subscriber_server
subscriber_type:
1 - Publisher
2 - Subscriber
|||Hi Darin,
In your Publication database...
select subscriber_type, subscriber_server
from sysmergesubscriptions
order by subscriber_type, subscriber_server
subscriber_type:
1 - Publisher
2 - Subscriber
|||issue an sp_helpdistpublisher or sp_helpsubscriberinfo
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Darin" <darin_nospam@.nospamever> wrote in message
news:eC92oo9BGHA.2704@.TK2MSFTNGP15.phx.gbl...
> What is the easy command (if any) to see if the server is a publisher or
> a subscriber in a replication environment?
> Darin
> *** Sent via Developersdex http://www.codecomments.com ***
Tuesday, March 20, 2012
quastion about triggers
hi,
I have a few quastions about triggers:
1) I want that to run a specific function or exe, after a row update.
How can I run a function via the trigger?
2) Is ther any trigger that for an updae of a culomn (not a row)?
thanks,
moria
Hi Moria,
First of all, there are differences id you implement the trigger on a CLR basis (2005) or on a TSQL basis (<2005), so next time, try to give some information about your system, that the proposed solution will better fit your needs.
"How can I run a function via the trigger?"
You talked about executing a EXE, therefore you cann call the extended procedure SP_CMDSHELL which is able to execute a program via the command line (More information about that can be found in the BOL)
COMMENT: It′s odd to execute a command in a trigger. Trigger bahve synchronously, while executing the trigger other people using the data won′t be able to change the lock data (depends on your locking, worst case would be table locking). If there is an error in your command (or a long running command), like waiting for input or something, the trigger will never come back, so you have to
keep that in mind.
"Is ther any trigger that for an updae of a culomn (not a row)?"
Well, yes and no. A trigger is fired per statement (not per ROW) and regardless if your "watched" column changed or not, but if you are in the trigger you have the possibility to use the
IF UPDATE(SomeColumn)
DoSomething
But the trigger is fired regardless, if the column changed or not, keep that in mind, if you have more than this statement in your trigger.
HTH, Jens Suessmeyer.
first of all, thank you for the detailed answer.
I am working with SQL 2000, and .NET 2005.
>>"More information about that can be found in the BOL"
what's BOL, and where can I find it?
>>we understand that an exe can block the SQL, but we want to know when a user updates a table so that we will run a certain program to take the new data, analyze it and reload it to another table. if not by an exe, how do you recommend to do it?
>>In case of deleted a column, is the trigger fired? which one?
thanks a lot,
moria.
|||Hello again,
"what's BOL, and where can I find it?"
http://www.aspfaq.com/show.asp?id=2229
If this is an external program you sure have to use the exe, but what about wrting a entry in a table that something changed on the program running on an at basis or as a service checks the data, does its recalculation (or whatever) and marks the process as done in the table ? Thats are designing question which cannot be decided on the basis of the only few information given.
HTH, Jens Suessmeyer.