Advertisement

04.24.2008 at 04:49AM PDT, ID: 23349870
[x]
Attachment Details

Ignoring last row of Flat File when doing BULK INSERT SQL Sever 2005

Asked by gareth_snook in Databases Miscellaneous, MS SQL Server, SQL Server 2005

Tags: Microsoft, SQL Sever, 2005, Using BULK INSERT from FlatFile

Hi,

I have been using sql server 2000 for many months successfully importing a flat file into my dbase.
the file has naming data in row 1 before the real data begins in row 2. the last row of the flat file always has a data string which can be ignored.

in 2000 i was using BCP import with cmdshell. now 2005 has come along i am unable to use cmdshell.

i have looked into BULK INSERT and this seems to be my answer however it fails on import saying unexpected end of file, which im putting down to the data string in the last row.

my question is how do i set bulk insert to ignore the last row in the flat file? the row is never the same row so LASTROW is out of the question i assume?

Please guide me!...

Many thanks

GarethStart Free Trial
[+][-]04.24.2008 at 04:56AM PDT, ID: 21429804

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 10:21PM PDT, ID: 21437200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 02:29AM PDT, ID: 21437957

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 03:52AM PDT, ID: 21438217

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 04:05AM PDT, ID: 21438272

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 04:28AM PDT, ID: 21438355

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 07:08AM PDT, ID: 21439702

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 07:29AM PDT, ID: 21439913

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 08:47AM PDT, ID: 21440715

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Databases Miscellaneous, MS SQL Server, SQL Server 2005
Tags: Microsoft, SQL Sever, 2005, Using BULK INSERT from FlatFile
Sign Up Now!
Solution Provided By: mark_wills
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.28.2008 at 02:59AM PDT, ID: 21452629

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 05:48AM PDT, ID: 21453396

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 06:04AM PDT, ID: 21453513

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628