I’m not a SQL DBA and I’m having an issue. We run MS SQL 2008 server and just upgraded it from MS SQL 2000. I’m trying to run a query created for the DB in MS SQL 2000 and use the results for our mailing list.
The query is:
SELECT DISTINCT Title, FirstName, MiddleInitial, LastName, Suffix,
CompanyName, BAddress, BAddress2, BCity, BState, BZip
FROM MailingExportView
WHERE AdvanceMailing = 0
ORDER BY BZip, LastName
Which gives us back something similar to:
Title FirstName MiddleInitial LastName Suffix CompanyName BAddress BAddress2 BCity BState BZip
Mr. Bob NULL Smith NULL NULL 12345 Main , Anytown State, NULL NULL
I’d like to not get the NULL. If the field is null ideally I’d like it to come back blank.
I’ve read about Null Processing from other sites and here;
http://technet.microsoft.com/en-us/library/ms170707.aspx
I’ve tried rearranging this so that the ISNULL will put the nulls in a different table:
How to replace blank (null ) values with 0 for all records?
http://bytes.com/topic/sql-server/answers/888443-convert-null-blank-if-not-null-remove-commas-string
http://www.w3schools.com/sql/sql_isnull.asp
I’m at a loss here. Can someone help me out?