Solved

DTS Package Help - NULL values

Posted on 2007-11-19
6
579 Views
Last Modified: 2013-11-30
I have a DTS package that is taking a view and writing it to a .txt file. It should be very straight forward but the .txt file is showing some weird results when dealing with NULL values.

In my view, some of the columns have text, some of the columns are always NULL, and some have a CASE statement that determines whether there is text in the field or if the value is NULL. The view looks fine. All fields with NULL values show up that way.

However, when the DTS package writes the view to the text file I have the problem. The fields with text are written properly, the fields with NULL are also presented properly. However, when the fields that have been determined by the CASE statement are written, if the field has been determined to be NULL it gets written with text delimiters '' instead of completely NULL. This does not happen with the other fields.

What am I missing? How do I get the DTS package to write the NULL fields to the text file without the text delimiters?

Thanks!

0
Comment
Question by:EpiKAC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 8

Expert Comment

by:digital_thoughts
ID: 20314180
It sounds like the CASE statement return isn't returning a NULL value, but rather a blank '' value, are you returning NULL is the case statement?

CASE WHEN Value='Something' THEN NULL ELSE Value END
0
 

Author Comment

by:EpiKAC
ID: 20314712
No, here's one of the case statements:
CASE WHEN dbo.tblAmt.rcomenh <> '1' THEN 'arial' ELSE NULL END AS pScrollingTextFont
0
 
LVL 6

Expert Comment

by:Spot_The_Cat
ID: 20316620
Hi,

When I test this I find that any fields in the DTS's text file  that are defined as quoted come out quoted irrespective of whether they have a case statement.

In the example I just tried, the first record with <NULL> came out as "" in the text file and the second record as "text". My CASE statement does exactly the same unless I define the column as non quotable.

So maybe I've misunderstood your query but that's exactly the behaviour I'd expect to see.

Spot
0
 
LVL 6

Accepted Solution

by:
Spot_The_Cat earned 125 total points
ID: 20316644
PS. - the 'ELSE NULL' is not required.

eg.

CASE WHEN dbo.tblAmt.rcomenh <> '1' THEN 'arial' END AS pScrollingTextFont

provides the same result.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question