Search code examples
sqlsql-server-2008sql-server-ce

drop all tables from sql ce database


Is it possible to executa a command which drops all tables from sql ce database ?

thanks for help


Solution

  • You can use information SCHEMA to generate a script:

    select 'drop table ' || table_name || ';'
      from information_schema.tables;
    

    Then run that script. You might need to run the script several times, since there is no CASCADE option (AFAIK) in SQLCE.