[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Stored Procedure SQL 2005

Posted on 2011-04-20
3
Medium Priority
?
292 Views
Last Modified: 2012-05-11
I have a stored procedure where I display the following column InsuredFile.LastName in a datasheet. What I want is if SlotType <> S then display InsuredFile.LastName if SlotType = S then display nothing for InsuredFile.LastName
0
Comment
Question by:mburk1968
3 Comments
 
LVL 19

Accepted Solution

by:
Bhavesh Shah earned 1000 total points
ID: 35432182
Hi,

you can use

SELECT CASE WHEN SlotType<>5 then  InsuredFile.LastName else '' end as LastName
FROM TableName

0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 35432255
Select (Case When SlotType <> 'S' then InsuredFile.LastName Else NULL END) From Table
0
 

Expert Comment

by:Fabs7
ID: 35432267
SELECT CASE WHEN SlotType<>5
              THEN InsuredFile.LastName END as LastName
FROM TableName

=> if SlotType=5 the value for LastName will be NULL!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question