0x49D1
0x49D1

Reputation: 8704

Batch script to delete all records from a SQL Server CE database table

Need a batch script to delete all records in a SQL Server CE database table. Don't know if its possible, I'm weak in scripting.

Upvotes: 0

Views: 1464

Answers (1)

ErikEJ
ErikEJ

Reputation: 41779

You can use my SqlCeCmd/SqlCeCmd40 command line utility from a batch file, with a command line like:

sqlcecmd -d "Data Source=C:\mydb.sdf" -q "DELETE * FROM MyTable"

(Or DROP the table and recreate with CREATE TABLE - faster)

Download from http://sqlcecmd.codeplex.com

Upvotes: 1

Related Questions