I'm trying to copy sql db between servers using Smo.Transfer class.
And it's ok when you're copying absolutely normal database. It works.
But what if your data inconsistent? For example I have a function and it gets the value from a table and non-existed column (someone renamed the column and now the function wouldn't work). But if you try to generate a script it will be generated ok.
But the problem begins when you actually try to run this script. Sql server wouldn't let you create the function, because It cannot refer to a non-existed column.
Something like that happens with Transfer class when you actually run .TransferData() method.
The questions is. Is it possible to skip somehow the creation of object (in our example the function) entirely?
How to catch the error, skip the object and let the .TransferData() method continue it's job?