Re: Stored Procedure - Obtaining Output
- From: "Hari Prasad" <hari_prasad_k@xxxxxxxxxxx>
- Date: Wed, 15 Jun 2005 00:43:11 +0530
Hi,
Use the below sample:-
Create proc testproc
as
Begin
IF EXISTS(SELECT 'x' FROM TABLE WHERE CODE = '123')
Select 'True'
Else
Select 'False'
End
Thanks
Hari
SQL Server MVP
"Wes" <Wes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7E26CCDA-0C47-42F6-99F8-40C29A260BF5@xxxxxxxxxxxxxxxx
> Hi,
>
> I would like to set up a stored procedure that does the following...
> - Check does a record exist in a table
> - Return the result (as True or False)
>
> My query is simply
> SELECT * FROM TABLE WHERE CODE = '123'
>
> How to I trap the output of this query (as a True or False)!
>
> Thanks,
> Wez
.
- References:
- Stored Procedure - Obtaining Output
- From: Wes
- Stored Procedure - Obtaining Output
- Prev by Date: Stored Procedure - Obtaining Output
- Next by Date: ODBC vs OLEDB
- Previous by thread: Stored Procedure - Obtaining Output
- Next by thread: ODBC vs OLEDB
- Index(es):
Relevant Pages
|
|