Register database from script folder
rickybibi
Posts: 25 Bronze 2
How to register a database from the script folder creates with "writetoFolder" ?
Comments
db.Register(path, null, options);
where 'db' is a fresh Database object, path is a string which contains the path to the folder, and options is an Options with whatever option set you want to use for registration.
The 'null' is where you would put a ReadFromScriptDatabaseInformation object if you didn't have a SqlCompareDatabaseInfo.xml file in the directory, but as you've just written it out you ought to have one already there with settings in. (If you want to set things like the database version yourself, or there isn't an xml file in the directory, pass in a ReadFromScriptDatabaseInformation object - you can just construct them with the empty constructor and then set the fields manually.)
Redgate Software
i receive a error.
I want to comparing a Scriptfolder and a Live Database.
Help :
Take the resulting Differences object, create a Work object, and call BuildFromDifferences with a WriteToFileOptions object.
Error
The differences parameter refers to a live database, but this API call is for scritps folder synchronizations.
Parameter name: differences
Your target database is the live database.
If your target database is a live database, you should not attempt to pass a WriteToFileOptions object to work.BuildFromDifferences, whatever kind of database your source database is.
So:
work.BuildFromDifferences(MyDifferences, Options.Default, true, MyWriteToFileOptions);
should be:
work.BuildFromDifferences(MyDifferences, Options.Default, true);
Hope that helps.
Redgate Software
Is't possible to define a different extension for each type script.
Example : .TAB for tables and .VIW for views ..
thanks
Redgate Software