I Now Have a Working Converter from SQLite Exports to SQL Server

It took me an awfully long time to program (even though it is only a few lines of code), but it is finally here! The page is divided into 3 “Steps”:

Step 1

The upper part shows the tables that already exist in the DB. This means that if you want to add new tables, you have to do it somewhere else and beforehand. The importer also cannot delete the contents of a table, and if something fails to be inserted because of a UNIQUE constraint or for any other reason, it is reported at the end as an error and nothing will be inserted into the table or bulk deleted from it. The lower part then lists the exported DBs, and the column on the right shows the tables that belong to the selected DB:

Table import part 1

Step 2

In step 2, the left column shows the column names loaded from the SQLite export. In the right part, you enter the names of the columns you want to map them to. The program does not check here whether you are mapping to the right column in terms of data type – you only find that out at the very end, when errors come pouring down on you, for example if you try to convert the string “abc” into a column with the int data type. Besides converting to data types, you can also save the value straight to a text or binary file, or discard all values from the given column – this is handy, for example, when you are merging 2 tables into one. Unfortunately, the program cannot yet select multiple exports and insert them all at once, and I do not know whether I will work on that, but maybe one day you will see another article about it on this blog:

Table import part 2

Image 2012-11-07 at 9.58.37 PM

Step 3

Step 3 is very simple and hardly deserves any comment – it just reports either the errors or that everything went perfectly fine.

Table import part 3

And finally, proof that it really works:

Artists table

Categories

Leave a Reply