[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

SSIS null value handling

SQL Beginner

3/22/2007 4:43:00 AM

Hi All,

I have text files which has lots of records in it. Each column is seperated
/ delimited by pipe (|) sign.

The problem i am facing is, after importing the textfile into sql server i
find that all empty values are replaced by hyphen (-) within the DB.

One way normally i will do is, i will import the textfile data into a
staging table in SQL Server. Then write a query to replace all hyphens with
blank / null value.

Now the problem is i need to do it without making use of staging table. Can
anybody help me in this?

Regards
Pradeep
2 Answers

masri999

3/22/2007 9:32:00 AM

0

On Mar 22, 9:43 am, SqlBeginner
<SqlBegin...@discussions.microsoft.com> wrote:
> Hi All,
>
> I have text files which has lots of records in it. Each column is seperated
> / delimited by pipe (|) sign.
>
> The problem i am facing is, after importing the textfile into sql server i
> find that all empty values are replaced by hyphen (-) within the DB.
>
> One way normally i will do is, i will import the textfile data into a
> staging table in SQL Server. Then write a query to replace all hyphens with
> blank / null value.
>
> Now the problem is i need to do it without making use of staging table. Can
> anybody help me in this?
>
> Regards
> Pradeep

use DTS and import the file and provide the delimiter as pipe

SQL Beginner

3/22/2007 5:04:00 PM

0

Yeah thats what I have done if you go through my earlier post. I am saying,
after importing --- for all null values sql server has written as hypens.

"M A Srinivas" wrote:

> On Mar 22, 9:43 am, SqlBeginner
> <SqlBegin...@discussions.microsoft.com> wrote:
> > Hi All,
> >
> > I have text files which has lots of records in it. Each column is seperated
> > / delimited by pipe (|) sign.
> >
> > The problem i am facing is, after importing the textfile into sql server i
> > find that all empty values are replaced by hyphen (-) within the DB.
> >
> > One way normally i will do is, i will import the textfile data into a
> > staging table in SQL Server. Then write a query to replace all hyphens with
> > blank / null value.
> >
> > Now the problem is i need to do it without making use of staging table. Can
> > anybody help me in this?
> >
> > Regards
> > Pradeep
>
> use DTS and import the file and provide the delimiter as pipe
>
>