-6

i open one transaction and insert a row into table and close the ssms and reopen and check table but uncommitted transaction were in the resultset why this happen please tell me

ARJUN
  • 49
  • 9
  • 2
    Depends on what your data is. If you only ever expect one record per day, ever, then sure. But personally, I'd just stick with an int-based ID. – Siyual Nov 01 '16 at 12:31
  • Show us your table definition if you want an answer that is more than just a guess. Typically I do not like date columns for keys, but sometimes its the best option. – Neo Nov 01 '16 at 12:42
  • A quick google search turned up this http://stackoverflow.com/questions/2267326/how-to-choose-the-clustered-index-in-sql-server – Neo Nov 01 '16 at 12:45

1 Answers1

0

date can be a good primary key for clustered index, but in general scenario, we don't link many tables (foreign key) using date.

i think it is depend on your er-diagram.

Alongkorn
  • 3,968
  • 1
  • 24
  • 41