?
Solved

DTS and Null Values

Posted on 2005-05-06
5
Medium Priority
?
392 Views
Last Modified: 2013-11-30
Hello,

I have a DTS package set up that is doing sevral equations.  I use CASE statements in a sub select and then have to Sum() some of the variables in the outer select (its kinda large and bulky so i dont want to post it unless i have to).

I have some values where part of the equation is Null, thus giving me a Null result, which is desired.  However, when i export the Null value i want something to show up in its place, weather it is a "Null" or a "0" i really don't care, i just dont want the absence of anything (which is what im getting now).

I cant use a case statement in the SQL because i am already Sum()'ing columns for my results.  I have messed around with the "Keep Null Values" option in DTS but weather it is checked or not i get blanks where the Null's are.

I am exporting to a fixed width text file.

Thanks!

-Navicerts
0
Comment
Question by:Navicerts
  • 3
5 Comments
 
LVL 14

Accepted Solution

by:
adwiseman earned 1800 total points
ID: 13945431
Have you tried using ISNULL(field, 'Null'), if you can't use it in yor SQL, wrap the entire query in a select

Select Field1, ISNULL(Field2, 'Null') as Field2
FROM (Your Query select statement goes here) as tmp
0
 
LVL 7

Author Comment

by:Navicerts
ID: 13946265
i would be nesting my query for a third time if i did that, wanted to avoid it :(
0
 
LVL 19

Assisted Solution

by:Melih SARICA
Melih SARICA earned 200 total points
ID: 13946530
if its not really important to use a fixed length text file.. try to use a delimeter..

0
 
LVL 7

Author Comment

by:Navicerts
ID: 13947155
fixed length is important unfortunatly
0
 
LVL 7

Author Comment

by:Navicerts
ID: 13947157
i guess the only way to do it would be to nest it again, thanks for the thoughts guys
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Ready to get certified? Check out some courses that help you prepare for third-party exams.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

809 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