none
snapshot: how to handle views dependant on functions/procedures RRS feed

  • Question

  • I am using SS 9.0, with Snapshot replication, a pull subscriber, both tables and views will be created.
    Procedures and functions are also included in the replication process.

    My snapshot is taken successfully.  When the subscriber pulls, and tries to recreate the DB, the process fails.

    Error message identifies a function or procedure that is called to create a view:
    Cannot find either column "dbo" or the user-defined function or aggregate "dbo.GetPostalDescription", or the name is ambiguous.

    The "dbo.GetPostalDescription" is a custom function that needs to be created first.  How can I tell the replication process to build the functions and procedures first before creating views?

    I have seen the option of defining a script to be executed before and after the snapshot is applied.  Is there an easy way to write a script to copy all function procedures and install them before snapshot?

    h

     

    Thursday, February 4, 2010 3:16 PM

Answers

  • Use a post snapshot script to add the views and add the functions to your publication.

    There is no way to generate a list of these missing objects to do this using replication tools . You will have generate it yourself.

    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941
    Thursday, February 4, 2010 4:14 PM
    Moderator