Loading empty data with NULL from text file source?? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Loading empty data with NULL from text file source??

Hi All,
I have a text file with one column where some of the data is blank where some of the records have some values like 0.9, -2.3,3.0,4 etc. I am loading that to one Table in SQL Server 2008. For those records where there is blank(empty) it gets loaded as 0 in my Sql server table. What is the work around with this? I do not want that to be loaded as 0. I want that to be NULL or someother number etc
My text files are on my local drive and I cant copy them to actual machine.

you can control this using bcp utility with -k flag

okay let me try this..Thanks

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |