Hello all,we have a couple of databases that have constant data change capture on them,without going in much detail it is allmost impossible storage wise to keep a consisten databackup on these & we don't really need one as the source system already has those if needed.However we need to maintain the structure so each week we want to run something that will generate an sql script for all the objects in the database.I have a script that does that,tested out very nicely,only got 2 issues left to resolve,getting the users & getting the schema.For instance we can have tables abc.def or def.abcI need to have the create script for abc. & def.I followed most of the stuff I could find about smo but when I try the schema's I get the following error[code]Error: 0x1 at Script Task: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Management.Smo.FailedOperationException: Discover dependencies failed. ---> Microsoft.SqlServer.Management.Smo.InternalEnumeratorException: Schema is not supported in dependency discovery. Only objects of the following types are supported: UserDefinedFunction, View, Table, StoredProcedure, Default, Rule, Trigger, UserDefinedAggregate, Synonym, UserDefinedDataType, XmlSchemaCollection, UserDefinedType, PartitionScheme, PartitionFunction, SqlAssembly.[/code]Is their a way around this issue.PSI'm making this in C# a language I had 0 experience with yesterday.
↧