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)
 Returning column data that IS NOT NULL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-02 : 09:14:34
Eric writes "Hi,

I have created a table that uses column names such as, problem_type, 5v_read, 12v_read, max_volts, etc. Data is then entered into the table by automatic means.

I query based on a particular problem type and return rows that match that problem type. This is fairly straight forward.

The catch is that I only want to return the field values for columns that aren't NULL. For instance, the table has 10 columns, but problem_type "XXXXXXX" may only have data pertaining to two columns. Rather than returning all 10 columns, I just want to return the 2 columns with data.

I'm using SQL Server 2000, SP2.

Thanks for any information you can provide.

Regards,

-Eric"

Jay99

468 Posts

Posted - 2002-04-02 : 09:27:58
The presentation layer of an application is usually best handled by something other than SQL. You can do what you are asking, but I would urge you to look for solving your display issues with your front-end toolset.

Jay
<O>
Go to Top of Page
   

- Advertisement -