SQL Server Compact 4.0 and default values
Posted: Sat 04 Jun 2011 17:31
Hi,
I have identified a problem (?) or at least handling that differs between for example SQL Server Express and SQL Server Compact.
Example:
(UC1 and UC2 are of type TUniQuery, UC1 has been opened before, f1 = string, f2 = string, f3 = int, nullable)
The following works fine with SQL Server Express, but with SQL Compact the assignment of f3 will fail if the value from UC1 is NULL.
Can I get around this somehow with some parameter or such or do I need to rewrite my code?
Thanks in advance, if neccessary, I can provide full example code.
I have identified a problem (?) or at least handling that differs between for example SQL Server Express and SQL Server Compact.
Example:
Code: Select all
UC2.SQL.Text := 'SELECT f1, f2, f3 FROM tblX';
with UC2 do
begin
Open;
Insert;
FieldByName('f1').Value := UC1.FieldByName('f1').Value;
FieldByName('f2').Value := UC1.FieldByName('f2').Value;
FieldByName('f3').Value := UC1.FieldByName('f3').Value;
Post;
end;
The following works fine with SQL Server Express, but with SQL Compact the assignment of f3 will fail if the value from UC1 is NULL.
Can I get around this somehow with some parameter or such or do I need to rewrite my code?
Thanks in advance, if neccessary, I can provide full example code.