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)
 getting null values :(

Author  Topic 

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2004-09-30 : 17:07:37
I am not understanding why this isn't working right. This is that table I have:
CREATE TABLE [dbo].[tblAfter_Accurint_High] (
[textfile] [nvarchar] (600) AS NULL )


INSERT INTO tblAfter_Accurint_High (textfile)
SELECT acctno+''+[name-last]+','+[name-first]+''+subj_address_1+''+subj_city_1+''+subj_state_1+''+subj_zipcode_1+''+akas_ssn_1+''+subj_phone10_1+''
FROM tblAccurint_Above1500

It is inserting null values every few rows. Can anyone see why? I can't figure it out :(

Thanks!

Brenda

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-30 : 17:14:02
It is because one of those columns from tblAccurint_Above1500 has NULL values in it. The default setting is when concatenating a value with a NULL value, that the entire string is NULL. To turn this off:

SET CONCAT_NULL_YIELDS_NULL OFF

INSERT...

Why are you concatenating a bunch of columns together into this new table? This seems like a design issue.

Tara
Go to Top of Page

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2004-09-30 : 17:42:46
Once again, you are a genious. Thanks Tara! The reason I am concatenating everything is because I am in the middle of designing a new application for my boss. Right now we use Paradox. Ever heard of it? That is how we import data after we get it back from having searches run on it. Anyway, thanks!

Brenda
Go to Top of Page
   

- Advertisement -