This is a discussion on Stumped by a BCP problem within the SQL Server forums, part of the Microsoft SQL Server category; --> I am trying to BCP some data collected with performance monitor into SQL Server. Here is the table that ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am trying to BCP some data collected with performance monitor into SQL Server. Here is the table that I'm trying to bulk copy into: create table perf_mon_stats ( server_name varchar(20) null, StatsTime datetime null, MemoryPages float(20), DiskQueueLength float(20), PctProcessorTime float(20), BufferCacheHitRatio float(20), UserConnections int) I have not been able to get BCP to load the data correctly though. Usaully about 700 out of 3000 rows get inserted but with many "String data, right truncation" errors. Then the BCP fails with an "Unexpected EOF encountered in BCP data-file". The data that does get inserted in badly mangled -- truncated, fields overflowing into other columns, etc. I have tried different datatypes in the table and in the format file to no avail. I have tried different field and row terminators in the format file. I have opened the source file in a hex editor and verified that the row terminators are \n\r and there is no rougue EOF anywhere in the datafile. If I use the DTS bulk-copy tool the data loads with no problem. If I take the format file that DTS generates and try to use it with BCP then it fails. Here is a sample of my datafile ppcreportdb,04/06/2004 00:00:00.010,365.93014208418583,2.953584523424652e-005,99.94904358901220 6,97.658311345646439,19 ppcreportdb,04/06/2004 00:00:15.010,28.879750108716959,86.711077372262778 ,0.70385851929092302,9 8.189563365282211,19 ppcreportdb,04/06/2004 00:00:30.010,30.999317288067498,89.810100000000006 ,1.1718746666666613,97 488503714184645,19 ppcreportdb,04/06/2004 00:00:45.010,30.93382198201714,91.693373333333327, 1.0156253333333365,98. 246869409660107,19 ppcreportdb,04/06/2004 00:01:00.010,28.800892131031468,88.949126666666672 ,0.98958333333333259,9 7.859424920127793,19 ppcreportdb,04/06/2004 00:01:15.009,35.201805073089595,93.357100000000003 ,0.85937466666666795,9 7.351978577804218,19 ppcreportdb,04/06/2004 00:01:30.009,32.067635652855465,93.28906666666667, 0.85937533333333427,98 133792707436115,19 Any help much appreciated. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |