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
 Transact-SQL (2000)
 How to display columns with space instead of NULL

Author  Topic 

Arif
Starting Member

10 Posts

Posted - 2005-10-24 : 04:45:44
I have a table with 3 fields. when I type
select * from test -- I am getting the results as below.

NAME AGE DEPT

AAA 23 AOD
BBB 27 NULL
CCC NULL NULL
DDD 23 POD

DEPT,AGE are displayed with "NULL" WHEN THERE IS NO value for that field . How can I eliminate this. I need space instead of NULL. When I export to text file there also contains NULL. Let me know how can I eliminate this.

Thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-24 : 04:52:50
Why did you post the same question at four forums?

Continue your discussions here
http://sqlteam.com/forums/topic.asp?TOPIC_ID=56811

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-24 : 04:53:14
stop cross-posting. posting the same problem in more than one place just annoys people and doesn't get your answer any faster.


Go with the flow & have fun! Else fight the flow
Go to Top of Page

asarak
Starting Member

36 Posts

Posted - 2005-10-25 : 01:02:15
select NAME isnull(AGE,' '),isnull(DEPT,' ') from test

You can use the "isnull" function which changes any Null value to the string that you want.

ISNULL ( check_expression , replacement_value )
Search in the SQL Server Books Online help and you have more examples...

Regards
ASARAK

Go to Top of Page
   

- Advertisement -