November 9, 2012 at 10:21 am
hi,
in my data viewer i am seeing correct data,but when i see in the table,its not ordered.
i have identity column so it should start by 1.
but when do something like this
select * from tablename order by id
then only i see in correct order.
but in data viewer everything is correct,how can i insert in table with id 1 as a first row
November 9, 2012 at 10:24 am
harri.reddy (11/9/2012)
hi,in my data viewer i am seeing correct data,but when i see in the table,its not ordered.
i have identity column so it should start by 1.
but when do something like this
select * from tablename order by id
then only i see in correct order.
but in data viewer everything is correct,how can i insert in table with id 1 as a first row
If you want data in a certain order there is 1 and only way to ensure it is in the order you want....use an order by. By definition tables in sql do not have an order.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 9, 2012 at 10:52 am
but when you insert record from ssis and in table i have identity column.
the first record should be like this
1 fg gh
2 fgf fgf
in the table.
here once ssis is finished ,i need to run query using order by to see result
November 9, 2012 at 12:16 pm
harri.reddy (11/9/2012)
but when you insert record from ssis and in table i have identity column.the first record should be like this
1 fg gh
2 fgf fgf
in the table.
here once ssis is finished ,i need to run query using order by to see result
If you want them inserted in a certain order you would need to have an order by on the insert. Given that you are using an identity I can't imagine why it would matter what order the identity column is.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 9, 2012 at 6:33 pm
SSIS will attempt to commit as many rows as are specified in the Max Commit Size of the OLE DB Destination Component. Once you submit a batch to SQL Server to insert rows it will depend on the available schedulers and system activity as to which rows in the batch will actually be committed first to the table, i.e. it is not predictable. If you need to guarantee that the order in which the OLE DB DEstination pushes rows to SQL Server is the order in which they are committed you must set the Max Commit Size to 1, but that will hurt performance greatly.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply