Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
chinna8143
Starting Member
2 Posts |
Posted - 2008-02-18 : 19:44:15
|
hello ...i me new to sql server will u plz help me out in this issuei have got an error while importing data from flatfile to sql server the error is when i tried to import data from flat file to sql server which is in comma delimited format i m getting this error ...in this if i have 25 rows in flatfile i m jus geting 24 rows inserted will u plz tell me how can i solve this issue i am using import/export wizard to import data...the data is in .csv extension and comma delimited...i have gt an error .....so and moreover i have appended the data to an existing table so how oculd i jus add the remaining row or what would be the solution for this do i need to do all the import again ,.....- Executing (Success)- Copying to [Kms_Roxane].[dbo].[Chargebacks1997_Roxane] (Stopped)MessagesWarning 0x8020200f: Data Flow Task: There is a partial row at the end of the file.(SQL Server Import and Export Wizard)Information 0x402090de: Data Flow Task: The total number of data rows processed for file "\\Syndevsql\DAS\Roxane\1997-112000 Roxane\Chargebacks2000_Roxane.csv |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-02-18 : 20:52:50
|
Seems have bad data in the file. |
|
|
tmitch
Yak Posting Veteran
60 Posts |
Posted - 2008-02-23 : 22:27:04
|
I suspect that your problem is that you don't have your line delimiter at the end of the last line. Your parser expects to find the line-terminating character sequence, by default the CR+LF combination. In most cases a line without this will be ignored. Check your data file and make sure that you have a carriage return after the last line of data.Hope this helps...Tim---------------------Tim Mitchellwww.BucketOfBits.com |
|
|
kgandre
Starting Member
2 Posts |
Posted - 2008-02-24 : 01:04:55
|
-- Open the CSV File and note the last record. (U said that there are 25 rows in total, so run the following SQL From the command prompt )BCP DATABASE_NAME.dbo.TABLE_NAME IN "\\Syndevsql\DAS\Roxane\1997-112000 Roxane\Chargebacks2000_Roxane.csv" -S"SERVER_NAME" -U"sa" -P"password_for_sa" -c -v -F24 -L25DATABASE_NAME ==> Database where the destination table resides.TABLE_NAME ==> Table where the data is loaded from the CSV File.SERVER_NAME ==> Server where the destination database resides.password_for_sa ==> sa password for SQL Server. -F ==> First line to start the copy-L ==> Last line to stop the copy.In your case since you wanted only the last record to be copied, I guess only the -F Parameter is enough. |
|
|
kgandre
Starting Member
2 Posts |
Posted - 2008-02-24 : 01:10:42
|
-- Open the CSV File and note the last record. (U said that there are 25 rows in total, so run the following SQL From the command prompt )BCP DATABASE_NAME.dbo.TABLE_NAME IN "\\Syndevsql\DAS\Roxane\1997-112000 Roxane\Chargebacks2000_Roxane.csv" -S"SERVER_NAME" -U"sa" -P"password_for_sa" -c -v -F24 -L25DATABASE_NAME ==> Database where the destination table resides.TABLE_NAME ==> Table where the data is loaded from the CSV File.SERVER_NAME ==> Server where the destination database resides.password_for_sa ==> sa password for SQL Server. -F ==> First line to start the copy-L ==> Last line to stop the copy.In your case since you wanted only the last record to be copied, I guess only the -F Parameter is enough. |
|
|
|
|
|