Create failed for database , SMO,C#
问题 I am trying to create a new database programmatically using SMO (c#). I am working on SQL Server 2005. This is the code : ServerConnection connection = new ServerConnection(serverName, userName, password); Server sqlServer = new Server(connection); Database newDB = new Database(sqlServer, databaseName); newDB.Create(); I get the exception : "Create failed for database." What could be the problem and how can I create a new DB? thanks... 回答1: I tried this: with a sysadmin user, everything works