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
Solved

DTS Package Help - NULL values

Posted on 2007-11-19
6
572 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL 10 35
SSIS On fail action 5 38
SQL Dump exec output to table 3 21
SQL Server show list of tables from a database with a parameter for the Database name 18 19
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

856 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