How do you return a constant from an sql statement?

How do I return a constant from an sql statement?

For example how would I change the code below so "my message" would return if my (boolean expression) was true

if (my boolean expression)
 "my message"
else
 select top 1 name from people;

I am using ms sql 2000

Answers


Did you try:

select 'my message';

Need Your Help

Microsoft Ribbon for WPF, RibbonButton LargeImage only

c# wpf xaml ribbon

if the RibbonButton contains no Label there is a lot of free space under the LargeImage icon. Instead of using a text, i would like to enlarge the image (width and height).

Using a new type in Python C Extension

python-2.7 python-c-extension

I have written code to define a new-type in Python C extension (MyStatus).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.