April 26, 2011 at 1:23 am
-- The error was caused by the following statement
-- FieldE is an non-null field
select FieldA, FieldB, FieldC
from TableD
where QuoteDate<GetDate() and Len(FieldE)=0
-- the following statements gave no error
-- no error
select FieldA, FieldB, FieldC
from TableD
where QuoteDate<GetDate()
-- no error
select FieldA, FieldB, FieldC
from TableD
where QuoteDate<GetDate() and FieldF='test' and Len(FieldE)=0
-- no error
select FieldA, FieldB, FieldC
from TableD
where QuoteDate<GetDate() and FieldE=''
I googled the error and found out that error is an known bug for SQL Server 2008. But what I read did not match the above description.
I guess my SQL2008 R2 is not up to date. Where can I check the version of my SQL Server?
April 26, 2011 at 3:43 am
SELECT @@VERSION
Cumulative Update # 6 is available for SQL Server 2008 R2
http://support.microsoft.com/kb/2489376
Regards,
Syed Jahanzaib Bin Hassan
MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
April 26, 2011 at 3:54 am
Can you post the actual error message, and the actual statement which causes it? The following works just fine on SP1:
CREATE TABLE #TableD (FieldE VARCHAR(10) NOT NULL)
INSERT INTO #TableD VALUES ('something')
INSERT INTO #TableD VALUES ('')
SELECT * FROM #TableD
SELECT *
FROM #TableD
WHERE LEN(FieldE) = 0
Also, what datatype is column FieldE?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply