Using FogBugz On Demand? We've recently rolled out a new sidebar as part of taking FogBugz forward. Please see this article for details on what's new, what's changed, and where you can find all your favorite things.

FogBugz will create its own schema if pointed at an empty database with one table in it:

CREATE TABLE Version (ixVersion int)

If FogBugz is pointed at such a database it will create all the necessary tables and fill them with default data.

Sometimes (particulary when you want to copy data into this table) you just want the schema and not all of the default rows that FogBugz needs to run (for instance default users, projects, areas, etc).

If your tables are not owned by ‘dbo’ when you move your FogBugz database you may find that the tables cannot be seen because of security restrictions.

You may also be able to use the following code:

SELECT 'EXEC(''sp_changeobjectowner @objname = '''''+ 
ltrim('.'+ ltrim(''''''<br />  +', @newowner = dbo'')'
FROM sysobjects s, 
sysusers u
WHERE s.uid = u.uid AND <>'dbo'
AND xtype in('V','P','U')
order by

For MySQL, here’s a script that will spit out truncate statements for all tables in a given database:

SET @new_database ='fogbugz1';

  "SELECT '",TABLE_NAME,"'; ",
  " TRUNCATE ",@new_database,".", TABLE_NAME,";") AS Statement 
    WHERE TABLE_SCHEMA = @new_database