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 2000 Forums
 SQL Server Development (2000)
 code question

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-17 : 08:14:40
shashank writes "CREATE procedure lnt.textt
@qurstr varchar(10)

AS

UPDATE empt
SET job_id = CASE WHEN @qurstr IN ('1', '3') THEN '999'
ELSE '456'
END
WHERE job_id = @qurstr
GO

Here I cretaed one proceduer,
now i want output such that it will print 'U misses mile' when
@qurstr = 1 or 3
Else it will print 'Sucess' (that means @qurstr NOT IN ('1', '3'))

T.I.A
Shashnk"

Kristen
Test

22859 Posts

Posted - 2005-08-17 : 08:37:10
Hi shashank, Welcome to SQL Team!

Is this the sort of thing you wanted, strikes me this is easy so your question is probably for something more complicated

SELECT CASE WHEN @qurstr IN ('1', '3')
THEN 'U misses mile'
ELSE 'Sucess'
END
FROM empt
WHERE job_id = @qurstr

Kristen
Go to Top of Page
   

- Advertisement -