"  DECLARE @tablename nvarchar(256), @constraintname nvarchar(256)\n"+
"  DECLARE @" + tableNameVars[2] + " nvarchar(256), @" + constraintNameVars[2] + " nvarchar(256)\n"+
    public void testTableConstraints() throws Exception    {        assertEqualsIgnoringWhitespaces(            "SET quoted_identifier on;\n"+            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'F' AND name = 'testfk')\n"+            "     ALTER TABLE \"table3\" DROP CONSTRAINT \"testfk\";\n"+            "SET quoted_identifier on;\n"+            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'F' AND name = 'table2_FK_COL_FK_1_COL_FK_2_table1')\n"+            "     ALTER TABLE \"table2\" DROP CONSTRAINT \"table2_FK_COL_FK_1_COL_FK_2_table1\";\n"+            "SET quoted_identifier on;\n"+            "SET quoted_identifier on;\n"+            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'table3')\n"+            "BEGIN\n"+            "  DECLARE @tablename nvarchar(256), @constraintname nvarchar(256)\n"+            "  DECLARE refcursor CURSOR FOR\n"+            "  SELECT object_name(objs.parent_obj) tablename, objs.name constraintname\n"+            "    FROM sysobjects objs JOIN sysconstraints cons ON objs.id = cons.constid\n"+            "    WHERE objs.xtype != 'PK' AND object_name(objs.parent_obj) = 'table3'  OPEN refcursor\n"+            "  FETCH NEXT FROM refcursor INTO @tablename, @constraintname\n"+            "  WHILE @@FETCH_STATUS = 0\n"+            "    BEGIN\n"+            "      EXEC ('ALTER TABLE '+@tablename+' DROP CONSTRAINT '+@constraintname)\n"+            "      FETCH NEXT FROM refcursor INTO @tablename, @constraintname\n"+            "    END\n"+            "  CLOSE refcursor\n"+            "  DEALLOCATE refcursor\n"+            "  DROP TABLE \"table3\"\n"+            "END;\n"+            "SET quoted_identifier on;\n"+            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'table2')\n"+            "BEGIN\n"+            "  DECLARE @tablename nvarchar(256), @constraintname nvarchar(256)\n"+            "  DECLARE refcursor CURSOR FOR\n"+            "  SELECT object_name(objs.parent_obj) tablename, objs.name constraintname\n"+            "    FROM sysobjects objs JOIN sysconstraints cons ON objs.id = cons.constid\n"+            "    WHERE objs.xtype != 'PK' AND object_name(objs.parent_obj) = 'table2'  OPEN refcursor\n"+            "  FETCH NEXT FROM refcursor INTO @tablename, @constraintname\n"+            "  WHILE @@FETCH_STATUS = 0\n"+            "    BEGIN\n"+            "      EXEC ('ALTER TABLE '+@tablename+' DROP CONSTRAINT '+@constraintname)\n"+            "      FETCH NEXT FROM refcursor INTO @tablename, @constraintname\n"+            "    END\n"+            "  CLOSE refcursor\n"+            "  DEALLOCATE refcursor\n"+            "  DROP TABLE \"table2\"\n"+            "END;\n"+            "SET quoted_identifier on;\n"+            "IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'table1')\n"+            "BEGIN\n"+            "  DECLARE @tablename nvarchar(256), @constraintname nvarchar(256)\n"+            "  DECLARE refcursor CURSOR FOR\n"+            "  SELECT object_name(objs.parent_obj) tablename, objs.name constraintname\n"+            "    FROM sysobjects objs JOIN sysconstraints cons ON objs.id = cons.constid\n"+            "    WHERE objs.xtype != 'PK' AND object_name(objs.parent_obj) = 'table1'  OPEN refcursor\n"+            "  FETCH NEXT FROM refcursor INTO @tablename, @constraintname\n"+            "  WHILE @@FETCH_STATUS = 0\n"+            "    BEGIN\n"+            "      EXEC ('ALTER TABLE '+@tablename+' DROP CONSTRAINT '+@constraintname)\n"+            "      FETCH NEXT FROM refcursor INTO @tablename, @constraintname\n"+            "    END\n"+            "  CLOSE refcursor\n"+            "  DEALLOCATE refcursor\n"+            "  DROP TABLE \"table1\"\n"+            "END;\n"+            "SET quoted_identifier on;\n"+            "CREATE TABLE \"table1\"\n"+            "(\n"+            "    \"COL_PK_1\"    VARCHAR(32) NOT NULL,\n"+            "    \"COL_PK_2\"    INT,\n"+            "    \"COL_INDEX_1\" BINARY(100) NOT NULL,\n"+            "    \"COL_INDEX_2\" FLOAT NOT NULL,\n"+            "    \"COL_INDEX_3\" CHAR(4),\n"+            "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\")\n"+            ");\n"+            "CREATE INDEX \"testindex1\" ON \"table1\" (\"COL_INDEX_2\");\n"+            "CREATE UNIQUE INDEX \"testindex2\" ON \"table1\" (\"COL_INDEX_3\", \"COL_INDEX_1\");\n"+            "SET quoted_identifier on;\n"+            "CREATE TABLE \"table2\"\n"+            "(\n"+            "    \"COL_PK\"   INT,\n"+            "    \"COL_FK_1\" INT,\n"+            "    \"COL_FK_2\" VARCHAR(32) NOT NULL,\n"+            "    PRIMARY KEY (\"COL_PK\")\n"+            ");\n"+            "SET quoted_identifier on;\n"+            "CREATE TABLE \"table3\"\n"+            "(\n"+            "    \"COL_PK\" VARCHAR(16),\n"+            "    \"COL_FK\" INT NOT NULL,\n"+            "    PRIMARY KEY (\"COL_PK\")\n"+            ");\n"+            "ALTER TABLE \"table2\" ADD CONSTRAINT \"table2_FK_COL_FK_1_COL_FK_2_table1\" FOREIGN KEY (\"COL_FK_1\", \"COL_FK_2\") REFERENCES \"table1\" (\"COL_PK_2\", \"COL_PK_1\");\n"+            "ALTER TABLE \"table3\" ADD CONSTRAINT \"testfk\" FOREIGN KEY (\"COL_FK\") REFERENCES \"table2\" (\"COL_PK\");\n",            createTestDatabase(TABLE_CONSTRAINT_TEST_SCHEMA));    }