batch copy stored procedures from one db to another

Hi everyone,

One of my customers’s live nav310 was half converted to V401 by user and consequently navision has created some v4 specific tables on sql server. It seems I could not cleanup the database by simply deleting those tables.

Hence, my current approach is to do a navision backup and restore it to a new 310 database. However, the downside of doing so is that the new 310 will lose all the sql views and stored procedures that the live 310 database currently has.

There are quite a few views/ sps, about 50. Is there a quick way of batch copying them?

Thanks

Use “Enterprise Manager” to generate a SQL script, then execute it (on new db) using "Query Analyzer

At such customer databases I always have a separate table with BLOB field. In this table all SQL procedures, functions and tables are stored (well, only creation scripts). Furthermore, there is a function which goes through this table and registers all the necessary SQL objects.

In case navision-style of backup/restore, the data of this table is also backuped/restored. After DB restore, I just run that special function, and all SQL objects are created again. This is extremely usefull when client has many companies in navision DB and your SQL objects are company-dependent.

You could look at my blog and get the realisation of such approach.

Laba Diena, Justas,

How to read your blog?

Achu

John

(p.s. that is about all I remember in Lithuanian, alas…)