{"id":546,"date":"2007-05-15T14:20:45","date_gmt":"2007-05-15T13:20:45","guid":{"rendered":"http:\/\/www.craigmurphy.com\/blog\/?p=546"},"modified":"2010-06-23T09:29:37","modified_gmt":"2010-06-23T08:29:37","slug":"moving-sql-server-2005-express-databases-to-sql-server-2000","status":"publish","type":"post","link":"http:\/\/www.craigmurphy.com\/blog\/?p=546","title":{"rendered":"Moving SQL Server 2005 Express databases to SQL Server 2000"},"content":{"rendered":"<blockquote><p><strong>23\/06\/2010 UPDATE<\/strong><br \/>\nThe database publishing wizard is integrated within Visual Studio 2008\/2010.<\/p>\n<p>Further information can be found <a href=\"http:\/\/blogs.msdn.com\/b\/webdevtools\/archive\/2007\/10\/15\/sql-database-publishing-wizard-is-now-in-visual-studio-orcas.aspx\">here<\/a>.\n<\/p><\/blockquote>\n<p>As you might well imagine, the on disk structure for SQL Server 2005 differs from that of SQL Server 2000.<\/p>\n<p>Indeed, restoring a SQL Server 2005 [Express] database backup for use with SQL Server 2000 isn&#8217;t really the done thing, as this <a href=\"http:\/\/forums.microsoft.com\/MSDN\/ShowPost.aspx?PostID=1042008&#038;SiteID=1\">post<\/a> confirms.<\/p>\n<p>After a little head-scratching with the SQL Server 2005 Express data export and scripting options, I deemed it necessary to create a SQL script that was not only capable of creating the database structure, but was also able to create all the <strong>INSERT<\/strong> statements necessary to recreate the data too.  And it had to create SQL suitable for SQL Server 2000&#8217;s dialect&#8230;<\/p>\n<p>Further head-scratching led me to the <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=56e5b1c5-bf17-42e0-a410-371a838e570a&#038;DisplayLang=en\">Microsoft SQL Server Database Publishing Wizard<\/a>.  It does exactly what I needed and allowed me to move a SQL Server 2005 database back down to SQL Server 2000, as these screenshots confirm:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.craigmurphy.com\/blog\/wp-content\/uploads\/2007\/05\/migrate1.gif\" \/><img decoding=\"async\" src=\"http:\/\/www.craigmurphy.com\/blog\/wp-content\/uploads\/2007\/05\/migrate2.gif\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.craigmurphy.com\/blog\/wp-content\/uploads\/2007\/05\/migrate3.gif\" \/><img decoding=\"async\" src=\"http:\/\/www.craigmurphy.com\/blog\/wp-content\/uploads\/2007\/05\/migrate4.gif\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.craigmurphy.com\/blog\/wp-content\/uploads\/2007\/05\/migrate5.gif\" \/><img decoding=\"async\" src=\"http:\/\/www.craigmurphy.com\/blog\/wp-content\/uploads\/2007\/05\/migrate6.gif\" \/><\/p>\n<p>So, in a nutshell, here&#8217;s what I did:<\/p>\n<ol>\n<li>Ran the Database Publishing Wizard against my SQL Server 2005 Express database.<\/li>\n<li>Created a SQL Server 2000-compliant SQL script that contained all the SQL statements required to create the database.  The SQL script also created all the INSERT statements required to populate the tables in the database.<\/li>\n<li>Created a new blank database in SQL Server 2000.<\/li>\n<li>Ran the SQL script from step 2 against the SQL Server 2000 database &#8211; using the Query Analyser.<\/li>\n<\/ol>\n<p>Of course, there&#8217;s often more than one way to skin a cat, your mileage may vary.<\/p>\n<p>Technorati Tags: <a href=\"http:\/\/technorati.com\/tag\/SQL+Server\" rel=\"tag\">SQL Server<\/a>, <a href=\"http:\/\/technorati.com\/tag\/SQL+Server+2005\" rel=\"tag\">SQL Server 2005<\/a>, <a href=\"http:\/\/technorati.com\/tag\/SQL+Server+2000\" rel=\"tag\">SQL Server 2000<\/a>, <a href=\"http:\/\/technorati.com\/tag\/SQL+Server+2005+Express\" rel=\"tag\">SQL Server 2005 Express<\/a>, <a href=\"http:\/\/technorati.com\/tag\/data+migration\" rel=\"tag\">data migration<\/a>, <a href=\"http:\/\/technorati.com\/tag\/SQL+Script\" rel=\"tag\">SQL Script<\/a>, <a href=\"http:\/\/technorati.com\/tag\/schema+and+data\" rel=\"tag\">schema and data<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>23\/06\/2010 UPDATE The database publishing wizard is integrated within Visual Studio 2008\/2010. Further information can be found here. As you might well imagine, the on disk structure for SQL Server 2005 differs from that of SQL Server 2000. Indeed, restoring a SQL Server 2005 [Express] database backup for use with SQL Server 2000 isn&#8217;t really &hellip; <a href=\"http:\/\/www.craigmurphy.com\/blog\/?p=546\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Moving SQL Server 2005 Express databases to SQL Server 2000<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[150,152,151,146,148,147,149],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-development","tag-data-migration","tag-schema-and-data","tag-sql-script","tag-sql-server","tag-sql-server-2000","tag-sql-server-2005","tag-sql-server-2005-express"],"_links":{"self":[{"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=546"}],"version-history":[{"count":2,"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":1741,"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions\/1741"}],"wp:attachment":[{"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.craigmurphy.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}