jan
2012-02-20 10:21:03 UTC
Hi all, I've run into a bug and AFAICS it's not me (you may well
decide otherwise though).
Setup is Win7, 32-big, dual core and sufficient memory, sql server
2008 R2, patched to SP1 (bug appears pre and post patch).
select @@version
->
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (Intel X86) Jun 17
2011 00:57:23 Copyright (c) Microsoft Corporation Developer Edition
on Windows NT 6.1 <X86> (Build 7601: Service Pack 1)
I'm creating functions and views and using those functions in views. I
end up with a handy view 'numeric_cols_diffs_classdefault'. It has two
fields (minclassdata and maxclassdata) which should, if present, never
be the same, so let's find if there any rows where they differ:
select *
from numeric_cols_diffs_classdefault
where minclassdata <> maxclassdata
->
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.
Doesn't like it.
Try in two steps instead:
select *
into #blaggle
from numeric_cols_diffs_classdefault
->
Warning: Null value is eliminated by an aggregate or other SET
operation.
(16309 row(s) affected)
- followed by -
select *
from #blaggle
where minclassdata <> maxclassdata
->
(84 row(s) affected) & I see the rows.
This cannot be right.
I started manually macro'ing out the functions and views to make a
large, clunky select, got it to work as expected ie. produced rows
without errors as per two-step above.
Views & funcs are not excessively nested, IMO.
Any thoughts?
I will try to isolate the code & data, anonymise it, and maybe post it
here if people want it.
cheers
jan
decide otherwise though).
Setup is Win7, 32-big, dual core and sufficient memory, sql server
2008 R2, patched to SP1 (bug appears pre and post patch).
select @@version
->
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (Intel X86) Jun 17
2011 00:57:23 Copyright (c) Microsoft Corporation Developer Edition
on Windows NT 6.1 <X86> (Build 7601: Service Pack 1)
I'm creating functions and views and using those functions in views. I
end up with a handy view 'numeric_cols_diffs_classdefault'. It has two
fields (minclassdata and maxclassdata) which should, if present, never
be the same, so let's find if there any rows where they differ:
select *
from numeric_cols_diffs_classdefault
where minclassdata <> maxclassdata
->
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.
Doesn't like it.
Try in two steps instead:
select *
into #blaggle
from numeric_cols_diffs_classdefault
->
Warning: Null value is eliminated by an aggregate or other SET
operation.
(16309 row(s) affected)
- followed by -
select *
from #blaggle
where minclassdata <> maxclassdata
->
(84 row(s) affected) & I see the rows.
This cannot be right.
I started manually macro'ing out the functions and views to make a
large, clunky select, got it to work as expected ie. produced rows
without errors as per two-step above.
Views & funcs are not excessively nested, IMO.
Any thoughts?
I will try to isolate the code & data, anonymise it, and maybe post it
here if people want it.
cheers
jan