sql - Update audit database name in triggers and views of main database? -


i have a system 2 databases, main database , audit database. lot of triggers , table views in main database , audit database referencing 1 database other. no needed change both databases names unfortunately failed work because still have old names in code.

is there code search , replace old name used referencing or in dependence?

thank you,

you have manually fix references can leverage sql find offending objects.

select object_name(id) objectname     , text objectcode sys.syscomments text '%yourreplaceddatabasename%' 

that give list of functions, procedures, views etc have old database name in code. have recompile each object after have updated code. utilize dynamic sql around nervous changes on scale automatically.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -