primary-key

RoR: Creating an Object with string primary_key (associated error: Couldn't find Object_Id with ID=0)

I created a model that had a string primary_key. The Create action in Ruby on Rails gave me the following error: Couldn't find Theme with ID=0 My Theme table has no ID column, but a string column called name which is the primary key. After searching everywhere, I experimented myself with the Create action inside the theme_controller....

Replacing PK's in Existing SQL DB Tables

Right now I have a DB where the PK's are int IDENTITY. I recently, in the last year, was tasked with adding these to a Replication Topology. This has worked out quite well with the exception of the IDENTITY fields. I want to explore my options for changing or replacing them with a uniqeidentifier(GUID). Is it feasible to insert a NEW ...

Create join table with no primary key

I have two tables with a many to many relationship that I am using has_and_belongs_to_many to define the association. class Foo < ActiveRecord::Base ... has_and_belongs_to_many :bar ... end class Bar < ActiveRecord::Base ... has_and_belongs_to_many :foo ... end I also have the class defined to represent the join table cl...

Problem with auto-generated primary_key using jpa on DerbyDB

I have jpa annotated entity class like: @Configurable @Entity @Table(name="PLAYERS") public class Player { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="ID") private Integer id; @Column(name="NAME") private String name; @PersistenceContext public transient EntityManager entity...

SQL Server performance difference with single or multi column primary key?

Is there any difference in performance (in terms of inserting/updating & querying) a table if the primary key is a single column (e.g., a GUID generated for every row) or multiple columns (e.g., a foreign key GUID + an offset number)? I would assume querying speeds should be quicker if anything with multi-column primary keys, however I ...

guid as primary key?

Hello, I have a mysql database which has 3 tables that have to be joined together. I receive smaller databases that must feed this mysql database, appending the new data as I get it. The problem I have is the smaller dbs that I get are generated by an outside application and are not really meant to be used all together. Therefore, whe...

How To Create a Complex Table in sqlServer ??

Hi everyone , Lets say I have a table called Employees , and each employee has a primarykey called (E_ID) and I have another table called Positions , and each Position has a primarykey called (P_ID) and I also have another table called offices , and each office has an ID called (O_ID) Now I want to create a table that has three primaryK...