I have a table that stores stock ticks in sql server 2008. It is keyed on the symbol column and the datecolumn which is a datetime2. In a c# app inserts are sent in at a high rate to the table. Currently a row is made using the symbol and DateTime.Now and then inserted. Occationaly the situation can arise where 2 ticks for the same symbol come in and the datetime.now will return the same time, down to the millisecond. My question is how can I assure that my inserts do not use the same time for a given symbol. I fiqure I could have another unique key like rowver or somekind of autonumber in the db as one solution, but even if the insert is successful I dont want there to be duplicte times for a given symbol. I've also thought about storing the last insert time and just adding a millesecond to it if it is equal. I'm not sure the best way to go about this. Also the datetime2 seams to have more precission than the .net datetime, so don't know if I should try to solve this on the server or the client.
Thanks
I want to keep every insert no matter what and for performance reasons I don't want to go with checking prior values, so the solution I will go with is an identity column. That will allow me to preserve the order of the inserts while allowing duplicates in the datetime2.