SQLServerDB extends BaseDB { @Override public String buildSQL(String template) throws IOException { template = replaceTemplate(template); template = reword(template); template = StringUtil.replace(template, "\ngo;\n", "\ngo\n"); template = StringUtil.replace( template, new String[] {"\\\\", "\\'", "\\\"", "\\n", "\\r"}, new String[] {"\\", "''", "\"", "\n", "\r"}); return template; } SQLServerDB(int majorVersion, int minorVersion); @Override String buildSQL(String template); @Override List<Index> getIndexes(Connection con); @Override String getNewUuidFunctionName(); @Override String getPopulateSQL(String databaseName, String sqlContent); @Override String getRecreateSQL(String databaseName); @Override boolean isSupportsNewUuidFunction();  }
@Test public void testRewordAlterColumnType() throws Exception { Assert.assertEquals( "alter table DLFolder alter column userName nvarchar(75);\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75);")); }
@Test public void testRewordAlterColumnTypeNoSemicolon() throws Exception { Assert.assertEquals( "alter table DLFolder alter column userName nvarchar(75);\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75)")); }
@Test public void testRewordAlterColumnTypeNotNull() throws Exception { Assert.assertEquals( "alter table DLFolder alter column userName nvarchar(75) not " + "null;\n", buildSQL( "alter_column_type DLFolder userName VARCHAR(75) not null;")); }
@Test public void testRewordAlterColumnTypeNull() throws Exception { Assert.assertEquals( "alter table DLFolder alter column userName nvarchar(75) null;\n", buildSQL("alter_column_type DLFolder userName VARCHAR(75) null;")); }
@Test public void testRewordRenameTable() throws Exception { Assert.assertEquals( "exec sp_rename 'a', 'b';\n", buildSQL(RENAME_TABLE_QUERY)); }