1

I am trying to replicate a portion of an SQL Server 2008 database in an Android application.

Is there anyway to import into SQLite directly from a script generated by SQL Server?

I have a come across one conversion tool, which is Windows only (doesn't help me), and there is no mention of how get the result onto the Android device.

2 Answers 2

1

Use the SQL Server Management Studio command "Generate Scripts". You choose the tables, and potentially include the data in the table. It will build the CREATE statements, along with the INSERT statements, if you choose. You may have to modify your column datatypes to fit SQLite.

Use any SQLite front-end as you like to execute those scripts into your Android SQLite file.

Sign up to request clarification or add additional context in comments.

1 Comment

@p.campell That's what I'm in the process of doing, just its 400 lines of SQL to inspect. I was hoping there was an easier way.
1

I have no experience with SQLite, but I have had a certain amount of success migrating data from MS SQL Server to other DBs by using .NET's DataSet.WriteXml to create an xml representation of the data which can then be imported. Takes only a few lines of code.

If you have the tools to develop in the Windows environment at all, I believe you can also connect directly to SQLite with .net, so that you could directly create your SQLite DB on that platform, then just move the DB file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.