Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL Server Management Objects
    primarykey
    data
    text
    <p>Am getting the same error on the code below using either trusted or SQL logins:</p> <blockquote> <p>VS2010, Console app .NET4, Win XP. SQL2005 Full.</p> </blockquote> <p>Bombs on the transfer.TransferData</p> <blockquote> <p>ERROR : errorCode=-1073548784 description=Executing the query "" failed with the following error: "Retrieving the COM class factory for component with CLSID {19E353EF-DAF4-45D8-9A04-FB7F7798DCA7} failed due to the following error: 80040154.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.</p> </blockquote> <p>this feels like security. Any thoughts would be awesome!</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; using System.Collections.Specialized; using System.IO; using System.Configuration; namespace GenerateScripts { class Program { static void Main(string[] args) { ServerConnection sourceConnection = new ServerConnection("localhost"); Server sourceServer = new Server(sourceConnection); //sourceServer.ConnectionContext.LoginSecure = false; //sourceServer.ConnectionContext.Login = "3tier"; //sourceServer.ConnectionContext.Password = "3tier"; Database sourceDatabase = sourceServer.Databases["3tier"]; // destination ServerConnection destinationConnection = new ServerConnection("localhost"); Server destinationServer = new Server(destinationConnection); //destinationServer.ConnectionContext.LoginSecure = false; //destinationServer.ConnectionContext.Login = "3tier2"; //destinationServer.ConnectionContext.Password = "3tier2"; Database destinationDatabase = destinationServer.Databases["3tier2"]; Transfer transfer = new Transfer(sourceDatabase); transfer.CopyAllObjects = false; transfer.DropDestinationObjectsFirst = false; transfer.UseDestinationTransaction = true; transfer.CopyAllDefaults = true; transfer.Options.Indexes = true; transfer.Options.DriAll = true; transfer.CopyAllDefaults = true; transfer.Options.AnsiFile = true; transfer.Options.SchemaQualify = true; transfer.Options.WithDependencies = false; transfer.CreateTargetDatabase = false; transfer.CopySchema = true; transfer.CopyData = true; transfer.DestinationServer = "localhost"; transfer.DestinationDatabase = "3tier2"; transfer.DestinationLoginSecure = false; transfer.DestinationLogin = "3tier2"; transfer.DestinationPassword = "3tier2"; transfer.Options.IncludeIfNotExists = true; transfer.TransferData(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload