println("  DECLARE @tablename nvarchar(60), @constraintname nvarchar(60)");
println("  DECLARE @tablename nvarchar(256), @constraintname nvarchar(256)");
    public void dropTable(Table table) throws IOException    {        String tableName = getTableName(table);        writeQuotationOnStatement();        print("IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = ");        printAlwaysSingleQuotedIdentifier(tableName);        println(")");        println("BEGIN");        println("  DECLARE @tablename nvarchar(60), @constraintname nvarchar(60)");        println("  DECLARE refcursor CURSOR FOR");        println("  SELECT object_name(objs.parent_obj) tablename, objs.name constraintname");        println("    FROM sysobjects objs JOIN sysconstraints cons ON objs.id = cons.constid");        print("    WHERE objs.xtype != 'PK' AND object_name(objs.parent_obj) = ");        printAlwaysSingleQuotedIdentifier(tableName);        println("  OPEN refcursor");        println("  FETCH NEXT FROM refcursor INTO @tablename, @constraintname");        println("  WHILE @@FETCH_STATUS = 0");        println("    BEGIN");        println("      EXEC ('ALTER TABLE '+@tablename+' DROP CONSTRAINT '+@constraintname)");        println("      FETCH NEXT FROM refcursor INTO @tablename, @constraintname");        println("    END");        println("  CLOSE refcursor");        println("  DEALLOCATE refcursor");        print("  DROP TABLE ");        printlnIdentifier(tableName);        print("END");        printEndOfStatement();    }