Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2005, 09:53 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remove Header and Trailer record???

I have a text file that has a header and trailer record how do i remove these so i can import into my table?

Example:

9 20050427 HEADER RECORD
0000000 00000 000000000 123456 00 654321 DATARECORD
0000000 00000 000000000 123456 00 654321 DATARECORD
0000000 00000 000000000 123456 00 654321 DATARECORD
0000000 00000 000000000 123456 00 654321 DATARECORD
6 20050427 TRAILER RECORD

The problem is more with the trailer record i can just start the import at row 2 but how do i determine where the LASTROW is and not import it?


Thanks
 
Old April 27th, 2005, 12:31 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

   I found a way but not sure if it will work for you purposes. On the data transformation task, right click and choose properties. Click on the options tab. There you can specify the first row and the last row to be imported. However this is only good if you know the number of rows in the text file.

Hopes this helps,

Jim
 
Old April 27th, 2005, 12:48 PM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am working with a transaction file that could have one record in it today and 10,000 the next day.

I know there is a LASTROW Parm used with BULK insert but i am know sure how to utillize it within DTS.

LASTROW [ = last_row ]

Specifies the number of the last row to copy. The default is 0, indicating the last row in the specified data file.

I think it would read something like this LASTROW [ = lastrow -1 ] byut where do i do somthing like this ActiveX script or SQL statement?????????

please help






Similar Threads
Thread Thread Starter Forum Replies Last Post
To remove the under line from the grid view header shalu .NET Framework 2.0 1 February 21st, 2008 07:31 AM
Record locking - user needs the next queued record cbtoolkit SQL Server 2000 0 December 6th, 2004 08:29 AM
First and Last Record in Report Header cc16 Access VBA 7 September 10th, 2004 09:37 AM
Sub record not associating with Main record Ron V Access 1 August 31st, 2004 09:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.