Questions tagged [sql-server-ce]

3695 questions
14
votes
3 answers

"If not exists" fails on SQL CE

I've got an unexpected problem. I'm making a script to update the schema on a SQL CE database. This won't run: if not exists ( Select column_name from information_schema.columns where column_name = 'TempTestField' and table_name =…
Mark Evans
  • 1,343
  • 1
  • 14
  • 28
14
votes
2 answers

How can I add a column to an existing table?

How can I alter a table in SQL Server Compact Edition (SQL CE)? I have an existing table, and I need to add an IDENTITY column.
Shiny
  • 1,053
  • 3
  • 13
  • 19
14
votes
2 answers

AssertionFailure: "null identifier" - FluentNH + SQLServerCE

The code fails at session.Save(employee); with AssertionFailure "null identifier". What am I doing wrong? using FluentNHibernate.Cfg; using FluentNHibernate.Cfg.Db; using FluentNHibernate.Mapping; using NHibernate; using NHibernate.Cfg; using…
Stefan
  • 4,166
  • 3
  • 33
  • 47
14
votes
4 answers

How to use Stored Procedure in SqlCE

I have just installed Sql Server Compact Edition. To my surprise, we can't use stored procedure in sql server CE. Do I have any alternative of Stored Procedure in Sql Server CE. I am strongly obsessed with stored procedure, I can'nt think of an…
Vaibhav Jain
  • 33,887
  • 46
  • 110
  • 163
13
votes
4 answers

Generate SQL CE database from EF Code-First DbContext class

I've defined a set of classes in the style of Entity Framework Code-First conventions and annotated the class properties with System.ComponentModel.DataAnnotations attributes. Now I want to generate a SQL Server Compact Edition (SCSE) (4.0) database…
13
votes
3 answers

Best way to export SQL Server database to sqlite (or SQL Server Compact)

Do someone know what would be the best way to transform a big SQL Server database to sqlite or SQL Server compact ? SQL Server database should be around 50-70Gb. There are some examples on internet (script schema) but I didn't find anything…
Ronan Lamour
  • 1,418
  • 2
  • 10
  • 15
13
votes
6 answers

How to use parameter with LIKE in Sql Server Compact Edition

I'm trying to parameterise a search query that uses the LIKE keyword with a wildcard. The original sql has dynamic sql like this: "AND JOB_POSTCODE LIKE '" + isPostCode + "%' " So I've tried this instead, but I get a FormatException: "AND…
Colin
  • 22,328
  • 17
  • 103
  • 197
13
votes
2 answers

Why saving changes to a database fails?

I have following C# code in a console application. Whenever I debug the application and run the query1 (which inserts a new value into the database) and then run query2 (which displays all the entries in the database), I can see the new entry I…
Joe Slater
  • 2,483
  • 6
  • 32
  • 49
13
votes
5 answers

SQL Compact select top 1

While porting an application from SQL 2005 to SQL Server Compact Edition, I found that I need to port this command: SELECT TOP 1 Id FROM tblJob WHERE Holder_Id IS NULL But SQL Server Compact Edition doesn't support the TOP keyword. How can I port…
Tomas Tintera
  • 787
  • 1
  • 8
  • 19
12
votes
1 answer

What happens if limit of Sql Server Compact Edition is reached?

What happens if a database reaches the limit of 4GB of the SQL Server Compact Edition? Is there a special exception for this? Can I safely catch this event or exception and, let's say, create a new database?
flash
  • 6,730
  • 7
  • 46
  • 70
12
votes
2 answers

How to check a SQL Server CE database for indexes?

Is there a way to list all SQL Server CE database table indexes, or at least for individual tables?
Kostas Konstantinidis
  • 13,347
  • 10
  • 48
  • 61
12
votes
1 answer

MS Sync Framework and SQL Server Compact

I develop a Windows C# application which can work in Online and Offline mode. When in Online mode it connects to a SQL Server. In Offline mode it connects to a local DB. I use the Microsoft Sync Framework 2.1 to sync the 2 databases on demand. Until…
juergen d
  • 201,996
  • 37
  • 293
  • 362
12
votes
1 answer

Reset AutoNumber(Identity Field) in Database

I Use a Sql Server Compact Edition Database File For Store the Data in My Windows Application Software. In this database I have a table with an identity field. When I insert a record into the Table, the identity code increments automatically. But…
Hossein Moradinia
  • 6,116
  • 14
  • 59
  • 85
12
votes
4 answers

What is the number of maximum concurrent connections for Sql CE 3.5?

as google does not deliver what i want to know, i try to ask stackoverflow :) what is the number of max concurrent connections to a sql ce 3.5 database? thanks j.
Joachim Kerschbaumer
  • 9,695
  • 7
  • 49
  • 84
12
votes
3 answers

SQL Server CE in a multi user scenario - is this really, really stupid?

I am trying to use SQL Server Compact Edition 3.5 as a database backend for a sales application. There would be 3-4 installations of a Windows Forms application which would all (via LINQ2SQL) read from and write to one .sdf file located on a network…
Edo
  • 1,821
  • 3
  • 20
  • 27