The reason why there are drop udf statements in the snapshot.pre script is
that the order required for dropping schema is exactly opposite that of the
order required for creating the schema object, and the reason why we still
have the drop <table|udf|proc> statement at the beginning of each .sch
script is for backward compatibility with downlevel subscribers. That said,
I have to say that dependency handling during replication snapshot
processing is quite broken in SQL2000 which is why a lot of work had been
done to beef that up substantially in SQL2005 transactional\snapshot
replication. It is still not "perfect" (pretty close in SQL2005 sp2 btw),
although I find myself having more problems convincing folks to upgrade.
You can specify a pre-creation command setting of 'none' to prevent your
UDFs from being dropped at the beginning of a snapshot although this will
prevent your UDFs from being refreshed with the delivery of a new snapshot.
-Raymond
[quoted text, click to view] "Marshall" <marshall.patterson@gmail.com> wrote in message
news:1166557601.940919.158980@n67g2000cwd.googlegroups.com...
> Thanks, Raymond.
>
> My subscribers are users with laptops running mobsync (windows
> synchronization manager) to replicate on demand. I can't guarantee that
> the user will re-start mobsync if they have some sort of connection
> failure. I want to be sure that the subscription database is left in
> some sort of useable format until they can run mobsync again.
>
> Is there a reason that the snapshot.pre file contains drop statements
> for all of my user-defined functions, but nothing else that is in the
> publication? I was hoping that there was some modification I could make
> to the publication to tell it to stop, but I'm not finding one.
>
> Thanks again for your assistance. Much appreciated.
>
> Marshall
>
>
> Raymond Mak [MSFT] wrote:
>> Hi Marshall,
>>
>> On SQL2000, if the snapshot delivery process failed mid-way, the whole
>> process will be started all over when the distribution agent is restarted
>> so
>> the function will be dropped (in snapshot.pre) and re-created again. That
>> said, it is safe to remove\modify the content of the snapshot.pre file
>> (but
>> not remove the file entirely).
>>
>> -Raymond
>> "Marshall" <marshall.patterson@gmail.com> wrote in message
>> news:1166468792.293969.131060@80g2000cwy.googlegroups.com...
>> > Hello all,
>> >
>> > I have a snapshot publication with several anonymous pulls set up to
>> > replicate several procedures and functions. I notice that the created
>> > snapshot has a file called snapshot.pre that seems to drop all the
>> > functions. I'm not sure why this would be necessary because each .sch
>> > file seems to start by dropping the function before re-creating it.
>> >
>> > If the snapshot always ran to completion, I could cope, but
>> > occasionally the sync fails mid-process. I am concerned that the
>> > subscribers could be left in a state without the user-defined
>> > functions.
>> >
>> > Am I missing the reason this snapshot.pre file needs to be in the
>> > snapshot? Can I safely edit/delete this file?
>> >
>> > Thanks much,
>> > Marshall
>> >
>