ALTER/RECREATE ASSEMBLY with dependency
pil0t
Posts: 14
I have database with CLR ASSEMBLY,
assembly contains a few scalar udf's, for example
myFunc1, myFunc2
This functions is used in computed columns in few tables.
I have changed "target platform" of ASSEMBLY from "x86" to "Any cpu"
and so, i have to DROP/CREATE assembly. (ALTER ASSEMBLY don't work when changing processorarchitecture)
Now i need to recreate assembly.
For this purpuses i create empty database, create my assembly (with changed processorarchitecture) and run SQL Compare.
Cheched my assembly to ALTER,
next i got table of dependencies of assembly, there are only my functions (myFunc1, myFunc2)
in script firs drops functions, then drops assemblym then create assembly, then create functions;
But this script is not correct, DROP function statmentns fails, because functions is used by computed columns in tables
So correct script should drop columns, drop funcs, drop assemblys , and then create all of this.
Making this thigs by hand is very boring, because i have about hundred columns used this clr udf's.
is there any way to automate this process?
assembly contains a few scalar udf's, for example
myFunc1, myFunc2
This functions is used in computed columns in few tables.
I have changed "target platform" of ASSEMBLY from "x86" to "Any cpu"
and so, i have to DROP/CREATE assembly. (ALTER ASSEMBLY don't work when changing processorarchitecture)
Now i need to recreate assembly.
For this purpuses i create empty database, create my assembly (with changed processorarchitecture) and run SQL Compare.
Cheched my assembly to ALTER,
next i got table of dependencies of assembly, there are only my functions (myFunc1, myFunc2)
in script firs drops functions, then drops assemblym then create assembly, then create functions;
But this script is not correct, DROP function statmentns fails, because functions is used by computed columns in tables
So correct script should drop columns, drop funcs, drop assemblys , and then create all of this.
Making this thigs by hand is very boring, because i have about hundred columns used this clr udf's.
is there any way to automate this process?
Comments
Redgate Software