|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
BCP different behaviour, v7 vs v2005, NULL=spaceSimilar to my earlier SQLCMD/OSQL question, I have some BCP commands
that I need to run on SQL Server 7. The command produces pipe- delimited output, but that's just an override on the separator character, and in SQL Server 7 <NULL> values come out as a single space, whereas in SQL Server 2005 they come out as an empty value. It turns out that this isn't a problem as the system that receives the data trims trailing spaces anyway, but I'd like to know if there is a way to tidy this up. My commands look a little like this: bcp %database%..%table% out %table%.txt -c -t"|" -U %user% -P %pw% I have tried the -k "keep NULL values" parameter but this makes no difference. Phil Hibbs. PhilHibbs (sna***@gmail.com) writes:
Show quote > Similar to my earlier SQLCMD/OSQL question, I have some BCP commands Hm, I was not able to repeat this on my SQL 7 machine (a virtual box,> that I need to run on SQL Server 7. The command produces pipe- > delimited output, but that's just an override on the separator > character, and in SQL Server 7 <NULL> values come out as a single > space, whereas in SQL Server 2005 they come out as an empty value. It > turns out that this isn't a problem as the system that receives the > data trims trailing spaces anyway, but I'd like to know if there is a > way to tidy this up. > > My commands look a little like this: > > bcp %database%..%table% out %table%.txt -c -t"|" -U %user% -P %pw% > > I have tried the -k "keep NULL values" parameter but this makes no > difference. if anyone wonders). Which service pack level is SQL 7 on? (Try "bcp -v"). -- Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
|||||||||||||||||||||||