You are here: Re: MS SQL for returning no values « MsSQL Server « IT news, forums, messages
Re: MS SQL for returning no values

Posted by Helmut Woess on 11/20/07 13:31

Am Tue, 20 Nov 2007 02:57:06 -0800 (PST) schrieb Ben:

> Hello,
>
> im having a problem integrating an SQL statement with my program,
> it works fine when theres a result but throws an error when there is
> no result,

.... and what is the error message ??

> Does anyone know of any SQL syntax for MS SQL that when no row is
> returned it makes on up and parses it back

I don't see any sense in this, but anyway, you can do something like:

if (select count(*) from persontable where id < 17) > 0
select id, lastname, street1, city from persontable where id < 17
else select 0 as id, 'testperson' as lastname, 'noStreet' as street1,
'noCity' as city

bye,
Helmut

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация