Esempio n. 1
0
        void CreateObjectsFromScript(DatabaseScriptWriter scripts)
        {
            Database db = server.GetDatabase(dbName);

            DatabaseScriptRunner runner = db.GetDatabaseScriptRunner();

            Console.WriteLine("Parsing Scripts to create database objects");
            foreach (ScriptObject obj in scripts.AllScripts)
                runner.RunScript(obj.Content);
        }
Esempio n. 2
0
 /// <summary>
 /// Gets a DatabaseScripts object containing the names and definitions for tables, views, and stored procedures
 /// </summary>
 /// <returns></returns>
 public DatabaseScriptWriter GetDatabaseScriptWriter(string Schema)
 {
     DatabaseScriptWriter scripts = new DatabaseScriptWriter(_database, Schema);
     return scripts;
 }