i have a problem with a view which uses an sp . while appyling the
snapshot,
the agent complains about the sp that view uses. i used to think that
agent take care of dependencies but it is not as in that case.
i drop publication and add the view as the last article of the publication
to be sure that sp is added before the view.. but that does not work too.
now i think to create the sp in the subscriber before the snapshot is
applied.
but how does the agent determine the order of scripts to apply?
another problem is about referential integrities. i am using dynamic
snapshots. the tables that have foreign keys complains about the
constraints. how can i be sure that data that is referenced inserted first.
thnx so much...
A view uses a stored procedure - are you sure - I'd like to see how this is
done

I suspect the view depends on other views or tables, and these dependencies
are not reflected in sql server's list of dependencies. You could try
refreshing the view (sp_refreshview), then add it to the publication and see
if that helps. Alternatively you could replicate the view using
sp_addscriptexec.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:uJwg0yjdFHA.2128@.TK2MSFTNGP15.phx.gbl...
> A view uses a stored procedure - are you sure - I'd like to see how this
is
> done

i am sorry

, not an sp , it is a udf.
> I suspect the view depends on other views or tables, and these
dependencies
> are not reflected in sql server's list of dependencies. You could try
> refreshing the view (sp_refreshview), then add it to the publication and
see
> if that helps. Alternatively you could replicate the view using
> sp_addscriptexec.
i investigated sysdepends , but it only reports the tables that the view
depends on , not the udf . (this view is not depending on any other view
also)
i would use addscriptexec to create the udf at the subscriber, i did not
use it before, therefore i have some suspects. would the script run,
everytime i merge or only when the subscription is initialized?
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Sysdepends on your publisher is out of sync. Script out each object in your
database and use this as your pre snapshot command, or simply run this
script in your subscriber database before running your publication. Note
also the sp_addscriptexec only works for subscriptions deployed through
uncs.
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
"uykusuz" <yb> wrote in message
news:OqEJfhjdFHA.1404@.TK2MSFTNGP09.phx.gbl...
> hi all;
> i have a problem with a view which uses an sp . while appyling the
> snapshot,
> the agent complains about the sp that view uses. i used to think that
> agent take care of dependencies but it is not as in that case.
> i drop publication and add the view as the last article of the
publication
> to be sure that sp is added before the view.. but that does not work too.
> now i think to create the sp in the subscriber before the snapshot is
> applied.
> but how does the agent determine the order of scripts to apply?
> another problem is about referential integrities. i am using dynamic
> snapshots. the tables that have foreign keys complains about the
> constraints. how can i be sure that data that is referenced inserted
first.
> thnx so much...
>
>
>
|||sp_addscriptexec only runs as a one off.
I'd consider placing the udfs in a separate publication and make sure this
runs before the publication containing the views.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||thank you..
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23iGwltldFHA.2688@.TK2MSFTNGP14.phx.gbl...
> sp_addscriptexec only runs as a one off.
> I'd consider placing the udfs in a separate publication and make sure this
> runs before the publication containing the views.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
>
|||"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%232TTupldFHA.1288@.tk2msftngp13.phx.gbl...
> Sysdepends on your publisher is out of sync. Script out each object in
your
> database and use this as your pre snapshot command, or simply run this
> script in your subscriber database before running your publication.
> Note also the sp_addscriptexec only works for subscriptions deployed
>through uncs.
Hilary, i am using dynamic snapshots, therefore i am not deploying the
subscriptions through unc, does that mean i can not use sp_addscriptexec ?
in fact i am a bit confused about dynamic snapshots. can you explain what a
dynamic snapshot agent really does?
when i create a dynamic snapshot in a folder, as far as i understand ,
firstly necassary scripts are copied to that folder then bcp's are created
according to filters. i had some strange errors about the files that have
different names in normal and dynamic snapshot folders. for example one is
named myUdf_2012 other is myUdf_2006. When i copy myUdf_2012 from normal
snapshot folder to dynamic snapshot folder , it worked.
[vbcol=seagreen]
> --
> 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
> "uykusuz" <yb> wrote in message
> news:OqEJfhjdFHA.1404@.TK2MSFTNGP09.phx.gbl...
> publication
too.
> first.
>
No comments:
Post a Comment