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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 problem in bulk insert

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-07-19 : 07:04:23
Attaullah Khan writes "i am using this query in my procedure in bulk inser

set @Blk_st='BULK INSERT Tmp_Resp_Rest FROM ' + ''''+ @File_name +''''

+ ' WITH
(
BATCHSIZE = 800,
CHECK_CONSTRAINTS,
DATAFILETYPE ='+''''+ 'widechar'+''''+',
FIRSTROW = 1,
ROWTERMINATOR ='+''''+ '\n'+''''+')'

i able to load the text data successfully from file to table but trailor is coming in middle.Please suggest me how to solve this problem where trailor should be last row."

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2005-07-19 : 19:15:05
The trailer record is most likely being read from the file last; it's probably just the way the table is being displayed when you query it. Bear in mind that SQL Server doesn't have any concept of 'first' or 'last' record. It displays tables in the row order it wants if you don't specify otherwise. You can set up a clustered index on the table that will sort on that field when you query from it. It might be easier for you to:
- Create an ID integer field on the destination table with automatic numbering (seeding)
- import the file using DTS and instruct the data lines to be inserted in the text/varchar column

Perhaps if you were to post some sample data and tell us what you're trying to do we can be of more help....

HTH,

Tim

Go to Top of Page
   

- Advertisement -