views:

409

answers:

1

I am sitting on a ton of data in a SQL Server 2005 database, from which we dump Access databases as a cache.

I want to create an iPhone app based on Core Data that can use this data from my SQL Server 2005 database, or the Access dump.

Based on all of the Core Data tutorials and documentation it appears that I have to use Xcode to create a Core Data schema and populate that schema using Xcode.

SQLite seems like the right thing to act as a dump point, then use SQLite APIs. But this doesn't bridge nicely to Core Data in my mass data scenario.

Apple has obsoleted the SQLite Books Example seemingly with the sole intent of making sure that you use Core Data and not SQLite.

Has anyone come up with a dump scheme for data locked in an Access or SQL Server 2005 DB into an iPhone friendly format? I don't care if it is Mac OS X code, iPhone code, or .NET code... Anything?

In my case I am talking about 26MB of data that I would like to have an offline cache to for my application.

26MB of XML seems like a bad idea. 26MB of SQLite seems like a great idea. 26MB of Core Data seems like an even better idea.

Thanks in advance, --Batgar

A: 

You could create an Objective-C app in XCode using the FreeTDS library to pull data down from your MSSQL database and populate your CoreData store.

http://sourceforge.net/projects/freetds/

There's also a commercial product that provides an MSSQL ODBC driver for Macs, which you could then call from your data migration code:

http://www.actualtechnologies.com/product%5Fsqlserver.php

If that doesn't work, you can set up the MSSQL database with an IIS front-end and retrieve the data using XML queries. Starting with MSSQL 2000, there's a way to query the server directly via HTTP and get back results in XML without having to write any ASP/ASP.NET code.

richardtallent
The key is to try allow the app to have the full data available offline. Thanks for the recommendations, I will take a look at FreeTDS and the ODBC driver. Would another way be to convert what I need into an XML format using C# / .NET on a Windows machine, then do a Core Data import from that XML?
Batgar
I understand--not suggesting you install SQL Server ODBC drivers on an iPhone, just suggesting how to batch import the data into CoreData. Yes, you could also use C# to generate XML and then import that, but that will require you to write *two* pieces of code: one for export, one for import. Using SQL Server's built in direct query interface (which provides generic but consistent XML) means you only have to write the import side, which would get the XML via HTTP from IIS with MSSQL directly behind it (no intermediate ASP.NET code). Good luck!
richardtallent