Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Simple judgment error

Author  Topic 

Alexmandro92
Starting Member

2 Posts

Posted - 2012-03-28 : 11:21:56
First sorry for my English. I'm new to this SQL server, I have worked in other languages ??such as MySQL or SQL and tried to make this query in SQL Server 2008: SELECT something FROM table WHERE true and I skip this error: An expression not boolean in a context where a condition is expected, near 'true'. It's weird because in other languages ??that judgment is correct. I want to make it after only having to add "and".

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-03-28 : 11:24:03
It is acceptable in one language doesn't mean it will be accepted in all language.
use

where 1 = 1



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Alexmandro92
Starting Member

2 Posts

Posted - 2012-03-28 : 11:27:25
Thank you very much. I had not fallen into something so simple :)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-28 : 11:58:18
whats the purpose of including this trivial check?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-28 : 13:03:48
what's the actual CODE

post that



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -