# Use of uniqueidentifer type for primary key?

**URL:** <https://www.ruby-forum.com/t/use-of-uniqueidentifer-type-for-primary-key/113768>\
**Category:** Rails\
**Created:** [September 4, 2007, 8:14pm UTC](https://www.ruby-forum.com/t/use-of-uniqueidentifer-type-for-primary-key/113768 "2007-09-04T20:14:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [September 4, 2007, 8:14pm UTC](https://www.ruby-forum.com/t/use-of-uniqueidentifer-type-for-primary-key/113768/1 "2007-09-04T20:14:37Z")

</div>

I’m working on a legacy SQL db. It is distributed, to they are using  
the uniqueidentifier type for the primary key.

At first, at least, I won’t be updating records, but I’m seeing a lot  
of negativity about using anything other than incrementing integers  
for the pk–which are obviously inadequate for this environment.

It is enough to use set\_primary\_key? Do I need more?

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [September 5, 2007, 12:50am UTC](https://www.ruby-forum.com/t/use-of-uniqueidentifer-type-for-primary-key/113768/2 "2007-09-05T00:50:49Z")

</div>

See if the information in this blog posting helps you:

> **[About Turn (or how to use Ruby on Rails with your existing application)](http://made-of-stone.blogspot.com/2006/06/about-turn-or-how-to-use-ruby-on-rails.html)**
>
> Since I started this blog (or at least refocused my occasional ramblings on using Rails with IIS and SQL Server) I have been meaning to writ...

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [September 5, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/use-of-uniqueidentifer-type-for-primary-key/113768/3 "2007-09-05T15:50:51Z")

</div>

Interesting. So the view is defined in the db, not in rails, right?
