How do I call a user defined function in a transactional replication. I've
tried a horizontal filter to get rows to replicate but that isn't working
very well.
FYI the makeup of the replication is this: aproximately 20
Publisher/Distributors and 1 central subscriber. All the remote servers use
transactional replication to send the subscriber. The horizontal filter
reduces the number of records but it sometimes does not send all the rows to
the subscriber. Once the repliaction fails to deliver all the rows (usually
after a day or so ) the missing rows are never replicated back.
here is an example - first a udf
CREATE FUNCTION test(@.state char(2))
RETURNS @.retauthors table (au_id char(11))
AS
BEGIN
INSERT INTO @.retauthors
SELECT DISTINCT authors.au_id FROM authors, titleauthor,
(SELECT au_id, test=COUNT(au_id) FROM titleauthor GROUP
BY au_id HAVING COUNT(au_id)>1) AS a
WHERE authors.au_id=titleauthor.au_id
AND a.test>1
AND authors.au_id=a.au_id
AND authors.state=@.state
AND titleauthor.au_id=a.au_id
RETURN
END
SELECT * FROM dbo.authors_filter('CA')
and here is an example of its usage in a filter
WHERE au_id IN (SELECT au_id FROM dbo.Authors_Filter('CA'))
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"LP" <LP@.discussions.microsoft.com> wrote in message
news:F0027B50-1CF0-4E08-929C-662B60B2CAB2@.microsoft.com...
> How do I call a user defined function in a transactional replication.
I've
> tried a horizontal filter to get rows to replicate but that isn't working
> very well.
>
> FYI the makeup of the replication is this: aproximately 20
> Publisher/Distributors and 1 central subscriber. All the remote servers
use
> transactional replication to send the subscriber. The horizontal filter
> reduces the number of records but it sometimes does not send all the rows
to
> the subscriber. Once the repliaction fails to deliver all the rows
(usually
> after a day or so ) the missing rows are never replicated back.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment