exec sp_executesql N'SELECT [customers].[dbo].[CUSTOMERS].[CUG] AS [Cug],
<snip fields>
WHERE ( [customers].[dbo].[CUSTOMERS].[CUG] IN
(@Cug1, @Cug2, ))',
N'@Cug1 int,@Cug2 int,',
@Cug1 = 0, @Cug2 = 5661
Hi
I have a problem that I hope somebody can explain. The above query is generated by LLBLGen when trying to retrieve the related customers for two other entities in a collection (related on the CUG field). One of the entities has a CUG of 5661 (seen in the second parameter),but the other has a NULL CUG field which seems to have been translated in the first parameter to a 0.
This is causing a problem as our Customer table actually has record with a CUG of 0 (historical reasons - dont ask...!) so LLBLGen is retrieving this one incorrectly.
Is there any way around this...? I'm assuming that the NULL is translated to a 0 as normally ID fields would start from 1 and would not be expected to have an entry for 0...?
TIA
Matt