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
 General SQL Server Forums
 New to SQL Server Programming
 Order by on bulk insert task

Author  Topic 

sanjnep
Posting Yak Master

191 Posts

Posted - 2007-08-23 : 14:43:40
I want to check sorted data option for bulk insert task on DTS Package. I want to sort data on 1st column. How can I put order by clause on sorted data option? I put ORDER (SSNo) but I am getting error.
Thanks
ss

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-23 : 14:45:34
what error on what code?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2007-08-23 : 15:01:52
I am using bulk insert task on DTS. There is Options tab on bulk insert task where we can check sorted data check box. I want to put ORDER (SSNo) clause to sort the data on this field but I am getting syntax error "The task failed during execution". How can I correctly put order clause on bulk insert task like in following BULK INSERT command?
_____________________________________________________________________

BULK INSERT PersonalDetails
FROM '\\ser667\tst1\pdetails.txt'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '|\n',ORDER (SSNo)
)
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-23 : 15:15:39
well try it in T-SQL and see what error you get.
also you have to have a clustered index on the SSNo for order to work correctly.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2007-08-23 : 17:28:24
I am not getting error on T-SQL but I am not able to set sort order on bulk insert task. Can any one tell how to use sorted data check box with example? I fill ORDER (SSNo)but it is not working.
Thanks
ss

Sanjeev Shrestha
12/17/1971
Go to Top of Page
   

- Advertisement -