Hi! I want to copy an existing SQL Server 2008 database schema, but not the data, to a new database on the same server (i.e MyDB => MyDB_Test) using C#.
I found some sample code at http://www.codeproject.com/KB/cs/CopyDBSchemaUsingSMO.aspx that seems to do exactly what I want but it kept throwing the following error on the ddatabase.Create() line:
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=9.0.242.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.":"Microsoft.SqlServer.BatchParser, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
I tried to find the missing DLL but I was only able to find a version for SQL Server 2005. I'm not sure if I should use that, look for an alternate download or take an entirely different approach.
Any help would be greatly appreciated!!