Question: I am developing a C # application and I want a window that displays all existing tables in the database the user make the choice of tables that want to recreate in a new database in a sql compact, some tables must contain the initial information and the other just the structure of the table.

Is there any help to recreate this table?

I think to generate the script of the existing table (\*.sql) and creating table from file to the new database, but I do not know how to make a query to generate a sql table.

PS: the existing table is in sqlserver, and I want to create a table in sqlcompact.

Answer: 
Add `:uniq => true` 

to 

```
has_many :students, :through => :responses, :foreign_key => "ID_Exam", :group => "response.ID_Student"

```

in your exam model
I have a suspicion your block within 

```
exam.students.each do |student|

```

is returning an array of 4 students. can you post that block too.