Sunday, January 31, 2010

SQL Compact data and schema script utility (ExportSqlCe) version 2.5 released

Version 2.5 of my CodePlex SQL Server Compact schema and data script toolset has been released. Go get it!

The project now includes a command line utility to script a SQL Server 2005/2008 database in SQL Compact SQL script.

The SQL Server Management Studio add-in has been updated to support the version of SQL Server Management Studio that comes with SQL Server 2008 R2.

Finally, 3 scripting engine bugs have been fixed, thanks to user feedback!

Other notable changes are noted below:

Release Notes

This release contains 4 downloadable files:
- SSMS 2008 scripting add-in  (Documentation)
- SQL Server 2005/2008 command line utility to generate a script with schema and data (or schema only)
- SQL Compact 3.5 command line utility to generate a script with schema and data
- SQL Compact 3.1 command line utility to generate a script with schema and data

Features added to SSMS add-in:
"Show Table Data" - also for INFORMATION_SCHEMA views (read-only)
"Show Table Data" - F3 search added

New command line utility:
Export2SqlCE - for scripting SQL Server 2005/2008 data and schema (or schema only) using SQL Server Compact syntax
(please test against your SQL Server databases, and provide feedback)

Fixes:
Fixed issue with ROWGUIDCOL not being scripted on "uniqueidentifier NOT NULL" columns (generator)
Fixed IDENTITY seed wrong when scripting schema and data (generator)
Fixed missing ; (semicolon) at end of IDENTITY_INSERT statement (generator)

Other:
Support for SQL Server 2008 R2 Management Studio (add-in)
Improved import error handling (add-in)
Updated Eqatec Monitor.dll (add-in)
"About" added to "Show table data" (add-in)

1 comment:

Unknown said...

Hello Erikej,

I've been trying to get your little tool to work but so far no luck.

I've been using the command line utility to try and get the schema for an sdf file of my project.

There are other ppl working on the same project and now i'm trying to put the whole thing together, including our database. So i'd need to get their schema and add the new tables they've created to my database.

I've tried the ExportSQLCE31 and ExportSQLCE versions.

The 31 one gives me the following exception:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl
y 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=8
9845dcd8080cc91' or one of its dependencies. The located assembly's manifest def
inition does not match the assembly reference. (Exception from HRESULT: 0x801310
40)
File name: 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicK
eyToken=89845dcd8080cc91'
at ExportSqlCE.Program.Main(String[] args)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
ion!EnableLog].

The other one gives me this exception:

Error: System.BadImageFormatException: An attempt was made to load a program wit
h an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Data.SqlServerCe.NativeMethods.DllAddRef()
at System.Data.SqlServerCe.SqlCeConnection..ctor()
at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
at ExportSqlCE.DBRepository..ctor(String connectionString)
at ExportSqlCE.Program.Main(String[] args)

Unhandled Exception: System.BadImageFormatException: An attempt was made to load
a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown)
at System.Data.SqlServerCe.SqlCeConnection.ReleaseNativeInterfaces()
at System.Data.SqlServerCe.SqlCeConnection.Dispose(Boolean disposing)
at System.Data.SqlServerCe.SqlCeConnection.Finalize()

Unhandled Exception: System.BadImageFormatException: An attempt was made to load
a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown)
at System.Data.SqlServerCe.SqlCeConnection.ReleaseNativeInterfaces()
at System.Data.SqlServerCe.SqlCeConnection.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()
at System.Data.SqlServerCe.SqlCeConnection.Finalize()


I've added both the sqlceme35.dll and System.Data.SqlServerCe.dll to the same directory as the exe files.

Any ideas?

Kind regards,

- Dirk
2nd year bachelor IT student

You can contact me on dirk@forbiddendream.be