Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:37:28+00:00 2026-05-22T19:37:28+00:00

I have an existing database (SQL Server) which has several tables connected using primary/foreign

  • 0

I have an existing database (SQL Server) which has several tables connected using primary/foreign key relationships. The database contains data and is used to populate a website.

I now want to use this data within a Mac/iOS application using CoreData and have created a data model and relationships as specified by Apple (and many others out there on the net). I have a simple service that pulls down the data from the remote system but am now struggling to see how I can use my CoreData model to persist this data on the device.

As CoreData is an object graph and not a database I do not know how I can preserve my primary/foreign key relationships as this is a CoreData implementation detail abstracted away from the developer. The data I have in my remote system relies on these already formed relationships to function correctly.

Does anybody out there know how to solve this issue or has come across it before? Or am I coming at this from the wrong angle?

Either way I need some way of replicating my remote data onto a Mac/iOS device.

Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:37:29+00:00Added an answer on May 22, 2026 at 7:37 pm

    Foreign keys are relationships in Core Data. To transfer your database, you’ll need to read through each row and make a new entity in Core Data. To recreate the relationships, you could store the old id data in there too, then query Core Data for an entity with that id, and create the relationship. If you only need to transfer it one time, you can delete the ids when the import is done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing SQL Server 2005 database that runs our accounting/inventory application. We
I have an existing database with tables which each have 4 partitions (there are
I have an existing database in mysql. One of my tables has discontinuous ids.
I have an existing SQL Server database, where I store data from large specific
I currently have two joined tables in a SQL Server database, one with news
I have to migrate existing data which is in SQL Server 2000 to SQL
I'm working with a legacy SQL Server database which has a core table with
I have an existing SQL Server database whose structure I can't really change, although
I've got a SQL Database Table, which has 35 existing records. One of the
I have an existing database of a film rental system. Each film has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.