views:

743

answers:

5

Is there a way to generate the sql statement for tables in sql server compact ? same as for sql server express+ ?

Essentially a create table( .... ) statement as output ?

A: 

You can connect to SQL Server Compact Edition using SQL Server Management Studio(SSMS), which in turn allows you to script out all database objects.

Please refer to: Managing SQL Server Compact Edition with SQL Server Management Studio

and then also, How to: Generate a Script

John Sansom
A: 

Using SQL Server Management Studio (a separate download) to export a "create database" script is the best way to go.

An alternative method, but more difficult/advanced method is to use SQuirreL database export plugin to create a script with JDBC.

I've used SQL servers own tool to generate scripts for years and that is the fastest and easiest.

djangofan
A: 

John - those options are not available for SSCE db's - try that

Note - I'm not able to comment as i don't have enough reputation so here it is

+1  A: 

There is a project on Codeplex that someone has actually built the functionality to be able to do scripting for sql server compact edition databases.

Richard B
A: 

There is a tool to do this. Check out http://www.antipodeansoftware.com/Home/Products This will iterate the entire SQL server, and write all the table, view, stored procedure and UDF scripts to a local drive. Great for adding SQL schema or DDL to source control.

Darryl