• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 481
  • Last Modified:

Give NULL value a name in SQL View

I have a view that I want to give a name to the "NULL" in the column  "Not Entered" would be the new value shown if it is "NULL"  if that makes sense...

Example of current Query
1 Solution
Surendra NathTechnology LeadCommented:
You can do it as below
change your select in your query as below

SELECT top (100) <all your columns as is now except trans agency >, CASE WHEN FDC_trans_agencies.descr IS NULL THEN ' NOT ENTERED' ELSE FDC_trans_agencies.descr END as [trans agency] <followed by the where as is>

NOTE: in the above statement the statement are to be replaced with what I said including the <>....
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:

SELECT blah, blah, blah, ISNULL(column_name, 'Not Entered') as column_name
FROM your_table

COALESCE can also be used if you want to pull this off using more than one column, but for your question above ISNULL works.
srodgers45Author Commented:
Thanks for the quick response. It worked...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now