empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r1090180 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
Date Fri, 08 Apr 2011 10:08:13 GMT
Author: francisdb
Date: Fri Apr  8 10:08:13 2011
New Revision: 1090180

URL: http://svn.apache.org/viewvc?rev=1090180&view=rev
Log:
EMPIREDB-104 Create DDL Script on MSSQL should state not CREATE DATABASE if already exist

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java?rev=1090180&r1=1090179&r2=1090180&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
Fri Apr  8 10:08:13 2011
@@ -466,7 +466,7 @@ public class DBDatabaseDriverMSSQL exten
                 return error(Errors.InvalidProperty, "databaseName");
             // Create Database
             script.addStmt("USE master");
-            script.addStmt("CREATE DATABASE " + databaseName);
+            script.addStmt("IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = '" + databaseName
+ "') CREATE DATABASE " + databaseName);
             script.addStmt("USE " + databaseName);
             script.addStmt("SET DATEFORMAT ymd");
             // Sequence Table



Mime
View raw message