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)
 SQL Statement to Query active columns

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-16 : 09:49:04
Brick writes "Does anyone know how in SQL Query Analyzer you can query a table and only get results from columns/fields that are active ?(i.e.have data in them)"

Nazim
A custom title

1408 Posts

Posted - 2002-01-16 : 09:56:04
your question is too vague, but still something like this

select * from tablename
where columname is not null

or

select * from tablename
where len(rtrim(ltrim(columname))) =0

and press Function key F5 it should execute the query.

----------------------------------
"True love stories don't have endings."
Go to Top of Page
   

- Advertisement -