views:

125

answers:

0

Hi,

I have a clinet sdf file (sql compact) that is created by the LocalDataCache.sync in Visual Studio 2008. The server is SQL Server 2008.

On the server if I do the following:

CREATE TABLE test (
            [firstfield]       float           NOT NULL DEFAULT 1,
            [secondfield] float           NOT NULL DEFAULT 2)
GO

INSERT INTO test
(secondfield) VALUES (55)

with

SELECT * from test 

I get 1 and 55 as my result because 1 is the default value and gets written to the table ok.

However, using SQL Compact I get an error saying NULL values not allowed.

This error is ONLY if I allow the database to be created by LocalDataCache in visual studio. If I create the table manually it inserts as expceted.

Does anyone have any suggestions?

Thank you