I want to copy data from a database to another, but I'd like to keep the primary key from the original database so it won't mess with the relationships. I'm using SQL Server 2008.
I have a OneToMany relationship in an SQL Server database.
When I add the tables to my Linq to SQL diagram (DBML) the relationship comes up as OneToOne.
I have other OneToMany relationships which synchronise correctly.
Even If I change the cardinality to OneToMany the collection still only returns a single entity.
Could this be a bug?
Hi, I am looking for an algorithm that would be useful for determining x y coordinates for a number objects to display on screen. Each object can be related to another object and there can be any number of relationships and there can be any number of these objects.
There is no restriction on the overall size of area on which to display these object.
I am writing this in php and would be looking to store the coordinates in an array.
I have a legacy rails (version 1.2.3) app which runs without issue on a number of servers (not to mention my local environment). Deployed to its newest server, though, and I now get ActiveRecord::StatementInvalid: Mysql::Error: #23000Column 'video_id' cannot be null errors.
Below are the models/relationships, simplified:
class Video < ActiveRecord::Base
has_one(:user, :dependent => :destroy)
end
class User < ActiveRecord::Base
belongs_to(:video)
end
And below is a rails console transcript of the relationships failing:
>> video = Video.create(:title => 'New Video')
=> #<Video:0xb6d5e31c>...
>> video.id
=> 5
>> video.user = User.create(:name => 'Tester')
ActiveRecord::StatementInvalid: Mysql::Error: #23000Column 'video_id' cannot be null: INSERT INTO users (`name`, `video_id`) VALUES('Tester', NULL)
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:243:in `execute'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:253:in `insert'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1811:in `create_without_callbacks'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:254:in `create_without_timestamps'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/timestamp.rb:39:in `create'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1789:in `create_or_update_without_callbacks'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:242:in `create_or_update'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1545:in `save_without_validation'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/validations.rb:752:in `save_without_transactions'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:129:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:95:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:121:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:129:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:451:in `create'
from (irb):3
from :0
Has anyone else come across ActiveRecord not sending an ID when it clearly knows it?
One to many relationships not working in ZODB as list is mutable.They say solution is Persistent Mapping or Persistent List or BTree.Can someone please tell me how is it exactly done
I am developing a my application on rails.It has 400 or more models.
And some model contains more than 200 rows just for relationships.
so it's too hard handle it.
Is there any ways i can handle my application more proper and easy ways.
Hi,
What would the basic C# code look like to model a many-to-many relationship, where the relationship itself has attributes? And also in this case the many-to-many was referential. So a possible database model for this might look like the following (just to give an example of what I'm talking about)
Nodes
ID
Name
Description
Relationships
Parent_ID
Child_ID
Relationships_Type
STRAGG function implemention returns a result as a single column value. Implementation for Oracle seems pretty generic and can be consumed for different tables (and relationships). Could similar behavior be achieved for SQL Server. A search in the web, appears to return only hard coded implementations and not a generic one. Do we have any known solution for Sql server?
There are many activities on an application that need things like:
Send email, Post to twitter
thumbnail an image, into several sizes
call a cron to find connected relationships
A good way to do these tasks is to write into an asynchronous queue on which operations are performed.
What django application can be used to implement such functionality, as the one Amazon Simple Queue service offers, locally?
I have come across celery. Right thing? Anything else that exists, like this?
Hi...I am a beginner in Rails and I read that the Rails enforces the foreign key relationships at the model level and also at the database level in the migration file, while creating the table. Is it really necessary and what kind of advantage does it provide
I'm walking into a project with 500+ classes, and am wondering if anyone has had good experiences with automated modeling tools that can import from ASP.Net /C#?
It would be a bonus if I could get an automated model based on all the objects called to completely load a single ASP.Net page, with relationships indicating which objects are calling out to which other ones, etc.
Thanks for sharing your thoughts or recomendations.
I want to generate something like the following:
LineItems
Id
ItemId
OrderId
Price
Orders
Id
CustomerId
DateCreated
Customers
Id
FirstName
LastName
Email
I don't need all the relationships, the diagram that will never print correctly, the metadata, anything. Just a list of the tables and their columns in a simple text format.
Has anyone done this before? Is there a simple solution?
Thanks,
Kyle
When adding relationships to a database model in DB Designer 4, a composite primary key is being created every time.
So every foreign key I add, I get an extra key added to a composite primary key.
I think I must have changed a setting as I don't remember it doing this in the past.
Does anyone know how to turn off this feature as I prefer to use a single surrogate primary keys in my database tables?
Hello,
I am using Shiro plugin for my grails application security, My application already has a user .Using the shiro plugin, we get a shiro user, now how do i integrate the shiro user with the normal user of my application,show i go ahead and use relationships or is it that the user class ahould be only a shiro user class now ??
I want to generate something like the following:
LineItems
Id
ItemId
OrderId
Price
Orders
Id
CustomerId
DateCreated
Customers
Id
FirstName
LastName
Email
I don't need all the relationships, the diagram that will never print correctly, the metadata, anything. Just a list of the tables and their columns in a simple text format.
Has anyone done this before? Is there a simple solution?
Thanks,
Kyle
Hello, is there any sample projects that I can download that shows alot of interaction with the entity framework and the mvc pattern of asp.net?
It should have stuff such as:
CRUD
CRUD on child records
Relationships
Inheritance
Thank you.
Hi folks,
I think this is an interesting question, at least for me.
I have a list of words, let's say:
photo, free, search, image, css3, css, tutorials, webdesign, tutorial, google, china, censorship, politics, internet
and I have a list of contexts:
Programming
World news
Technology
Web Design
I need to try and match words with the appropriate context/contexts if possible.
Maybe discovering word relationships in some way.
Any ideas?
Help would be much appreciated!
I got pretty experienced with testing controllers, my question here is though, aren't we supposed to test the data context as well, and how ? I mean, there are a lot of relationships and constraints coming from the DB that simply testing controllers does not cover.
On the other hand, testing against the DB is not considered a good practice - what then ? Simply testing without db.SubmitChanges() or what ?
After upgrading to Rails 3, fixtures that refer to other labelled fixtures (for relationships) stop working. Instead of finding the actual fixture with that name, the fixture label is interpreted as a string.
Example:
# Dog.yml
sparky:
name: Sparky
owner: john
# Person.yml
john:
name: John
Where Dog "belongs to" person.
The error message is:
SQLite3::SQLException: table dogs has no column named 'owner'
Alright so I want to convert an already exist MSSQL database (2005) to a MYSQL database.
There is nothing extraordinary to be done
The only things I need to achieve is
Recreate the tables
Transfer data
Relationships would be nice but not necessary
No views, no sprocs, no functions.
Any easy way to do this.
Also do you know of any DST (Database Synchronization Tool)
which would let me do
MSSQL to MYSQL
MYSQL to MYSQL
MSSQL to MSSQL (I know there is SQL Delta for this)
The objective of skeletonization is to represent a binary image with a minimum set of pixels. The skeleton must account for geometrical properties of the form and retain associative relationships.
My question here is how can i get a skeleton from binary image ?
Hi! I have huge database (kinda wordnet).
And want to know if it's easier to use Cassandra instead of MySQL|PostrgreSQL
All my life I was using MySQL and PostrgreSQL and I could easily think in terms of relational algebra, but several weeks ago I learned about cassandra and that it's used in facebook and twitter.
Is it more convenient?
What DBMS are usually used nowadays to store social net's data, relationships between objects, wordnet?
Can somebody tell me, why does Linq to Entities translate many to 1 relationships to left outer joins instead of inner joins? It relation was many to 0..1. There's referential constraint on DB itself, that ensures there's a record in the right table, so inner join should be used instead.
Is it possible to write LINQ in a way so they will translate to inner joins rather than left outer joins. It would speed query execution a lot.
Hello,
I started learning DBIx::class and I reach the point where you have to create the Objects that represents tables. Should this classes be created manually ( hard coding all the fields and relationships.....) or there is a way to generate them automatically using the database schema. I read something about loaders, but i did not know where they are really used.
Please advice.
Thanks
The objective of skeletonization is to represent a binary image with a minimum set of pixels. The skeleton must account for geometrical properties of the form and retain associative relationships.
My question here is how can I get a skeleton from binary image?