0

I have an SQL Server 2008 database. All tables having a GUID as the primary key, and they are NOT auto-generated. Rather, I want my code to generate it and pass it in INSERT operation. Some of the tables are having one-to-one or one-to-many relations with other tables.

Is it easy to implement having CRUD operations for such kind of database, where the end-user will not need to worry about GUIDs and all? I searched for tutorials for this, but couldn't find. Can anyone guide me in right direction?

I have MVC 4 in Visual Studio 2010.

tereško
  • 58,060
  • 25
  • 98
  • 150
Nirman
  • 6,715
  • 19
  • 72
  • 139
  • I gotta ask why all your primary keys are GUIDs and not something more...normal like integers - something that can be efficiently indexed, etc. Why? – Dan May 07 '13 at 04:17
  • What exactly is your problem? Guid is always unique. – Piotr Stapp May 07 '13 at 04:22
  • @Garath May be not always... – Bhushan Firake May 07 '13 at 04:27
  • 1
    There are many advantages of having GUID as primary key, and they are unique as far as I know (i've read many blogs for this, and they all reckon its unique!). – Nirman May 07 '13 at 04:56
  • @BhushanFirake Not exactly always but probability of same guid is almost zero look here: http://stackoverflow.com/questions/39771/is-a-guid-unique-100-of-the-time – Piotr Stapp May 07 '13 at 06:05

0 Answers0