How to: Import a Schema From a Command Prompt
You can import objects and settings from a database or server into a .dbschema file at a command prompt by using the VSDBCMD tool. For more information, see Starting Team Development of Databases That Reference Other Databases. You might use this tool if the computer where you use Visual Studio Team System Database Edition does not have network access to the database or server from which you want to import objects and settings. To use this tool, you must copy it and the following files either over a network or to a universal serial bus (USB) drive:
DatabaseSchemaProviders.Extensions.xml
Microsoft.Data.Schema.dll
Microsoft.Data.Schema.ScriptDom.dll
Microsoft.Data.Schema.ScriptDom.Sql.dll
Microsoft.SqlServer.BatchParser.dll
Sqlceer35en.dll
Sqlceme35.dll
Sqlceqp35.dll
Sqlcese35.dll
System.Data.SqlServerCe.dll
VSDBCMD.EXE
You can specify additional arguments at the command prompt. For more information, see Command-Line Reference for VSDBCMD (Deployment and Schema Import).
To copy the supporting files to your USB drive
Navigate to the [Program Files]\Microsoft Visual Studio 9.0\VSTSDB\Deploy folder, and copy the contents of that folder to your USB drive.
Navigate to the [Program Files]\Microsoft SQL Server Compact Edition\v3.5 folder, and copy the DLLs that are listed earlier in this topic to your USB drive.
Next you use these files to import objects and settings for a database or a server.
To import database objects and settings by using VSDBCMD
Open a Command Prompt window, and type the following command line:
VSDBCMD /a:Import /cs:"connectionstring" /dsp:Sql /p:ModelType:Database /model:DatabaseName.dbschema
For DatabaseName, you specify the name that you want to give the .dbschema file.
To import server objects and settings by using VSDBCMD
Open a Command Prompt window, and type the following command line:
VSDBCMD /a:Import /cs:"connectionstring" /dsp:Sql /p:ModelType:Server /model:ServerName.dbschema
For ServerName, you specify the name that you want to give the .dbschema file.
See Also
Concepts
Terminology Overview of Database Edition
Build and Deploy Databases to a Staging or Production Environment
Reference
Command-Line Reference for VSDBCMD (Deployment and Schema Import)