We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Stored Procedure SQL 2005

mburk1968
mburk1968 asked
on
Medium Priority
299 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
Comment
Watch Question

Lead Analyst
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)
CERTIFIED EXPERT

Commented:
Select (Case When SlotType <> 'S' then InsuredFile.LastName Else NULL END) From Table

Commented:
SELECT CASE WHEN SlotType<>5
              THEN InsuredFile.LastName END as LastName
FROM TableName

=> if SlotType=5 the value for LastName will be NULL!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.