First of all, that table is setup for CDR's (Call Detail Records). Rather I should say it's set up incorrectly for CDR's. Almost all of the columns are setup for VARCHAR(255) and the world of code is going to crawl because of all the implicit and explicit conversions you will need to make to rate, bill, and invoice the CDR's. Step 1 should be to assign the correct datatypes for each column.
Second... How often will you be inserting rows that are out of date order compared to what's at the "end" of the table? If it's a lot and your CI is on the date, you will get a lot of page splits. If it's a lot and your CI in on the autonumbering column, then you're inserts will be fine but your SELECT's may suffer a bit. It's a tradeoff depending on what the table will be used the most for... Inserts or Selects.
Are you going to use the contents of this table for rating and billing or are you just capturing CDR's for long term audits? And what's the source of information for this table? If it's coming directly from one or more switches as the calls occur, then you will definitely want the CI either on the IDENTITY column or on the call date time column.
No matter what, you really should fix the datatypes as previously stated.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs