Using SORT operator a NVARCHAR column
-
Thursday, February 07, 2013 3:50 PM
Hi,
In my package i have a field (HOUR, datatype nvarchar(255)). It has values 5AM,6AM,7AM,8AM.............8PM. I want them in the same order but once the data is loaded into the table they are not displayed in the order. I tried using SORT but still i get the same results. Is there a workaround when sorting NVARCHAR's . The source is an excel spread sheet. Any advice would be great.
Thanks
All Replies
-
Thursday, February 07, 2013 7:34 PM
This is surely table design issue.
Are you having primary key as different column?
Please Mark posts as answers or helpful so that others can more easily find the answers they seek.
-
Thursday, February 07, 2013 7:51 PMModeratorIf you want the exact order then you need to add a rownumber column within SSIS (or add a autoindent column in the table). Then you can order by that column.
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
-
Thursday, February 07, 2013 8:57 PM
Never assume what you send in the the table is saved in the same manner. The data might go in order in one page, but if it spreads across multiple pages there will be no order maintained. Always use a sort column based on which you may sort the data. Something like a identity column.
My Blog | Ask Me | SSIS Basics
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Thursday, February 14, 2013 3:02 AM

