 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
This is 2 bugs which I found yesterday. Hope you will fix it soon ^^.
1) Table A which has more than 1 fields reference to table B will generates error. 2) Copied data cannot display Vietnamese properly. I used sqliteman and sqliteadmin to check the data but got the same result.
Thx alot for this greate soft.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
If you can send me a sample SQL Server database file I'll be able to check it and (hopefully) solve it.
Send the file to liron.levi@gmail.com
Thanks in advance Liron Levi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I will send you the database. It's a program created by hobby, so there is no need to hide the database to you ^^
About the display bug, it's a bug of Sqliteadmin and SqliteMan. I finally can display it properly with Database.NET with a few change in your code. Maybe your original code should work too, but I did not test the original code yet. Sorry then ^^
But when using SubSonic to generate sources for the SQLite file, it's keep saying that the SQLite table has no primary key field. Therefore, it generated a blank source file instead >.< I googled and knew that SQLite doesnt have a foreign key, but what about a primary key? I think it does have a primary key and probably is it another bug of this program? Am I wrong?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I think you are wrong.
The converter program creates a PRIMARY KEY if the original table has one. Maybe the original database didn't have a PRIMARY KEY ?
I'm checking the database you've sent me. Maybe I'll find something there..
Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am not sure about this bug but my database does have primary keys and foreign keys. You can check it immediately in the database that I sent.
Maybe this is a bug of subsonic? By the way, I have converted my database to SqlCe and tried to use it with subsonic too. Got another error with something called PK_Table >.<
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi
You can easily check if the generated SQLite database table contains a PRIMARY KEY column. If so - this is is a bug in subsonic. Otherwise it may be a bug in my code.
Unfortunately I'm currently swamped with work so I'll get back to this in a day or two. Sorry for the delays 
Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Sorry for the late reply. Im a little busied last days.
In this method > private static string BuildCreateTableQuery(TableSchema ts) you check if primary key exists or not > if (ts.PrimaryKey != null && ts.PrimaryKey.Count > 1) but I think the condition must be "ts.PrimaryKey.Count > 0", otherwise it only generate primary key for 2-keys above table.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi
The check relates to the case when we want to create the PRIMARY KEY as a table constraint. There are two cases:
1. A single PRIMARY KEY column. In this case - I'll create the PRIMARY KEY constraint as part of the column declaration. 2. A multiple column PRIMARY KEY constraint. In this case - I'll create the PRIMARY constraint as part of a table level constraint.
The check you've written about will create a table-level PRIMARY KEY constraint only when there are more than 1 primary key columns. There is another check for creating a column-level PRIMARY KEY constraint when there is only a single column PRIMARY KEY.
The software should create a primary key for 1-key table. It will simply create it as a column level constraint.
If the software didn't create this key - please write to me about it, but it should work OK as far as I know.
Best Regards Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Oh, sorry for the mistake.
I checked the "(1) single PRIMARY KEY column" that you said and it's seems to me that you only generate PRIMARY KEY for IDENTITY column?
I checked with a table which has a nvarchar primary key and sadly it DID NOT generate the PRIMARY stuff for that primary column.
Can you check this point again?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Hi
I've fixed the bug and sent an updated version (1.12) to the moderators at codeproject. It should be available once they have the time to update the article.
Thanks Liron Levi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Liron,
Thanks for your program. It has been of great use to me I have added some code to add triggers enforcing foreign keys. I am aware there should be a separate application for this functionality and maybe it should not be part of the conversion. Still if you're interested i can clean up my code and send it back to you
Greetings, Martijn
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Sure I'm interested. You can add a separate checkbox for this purpose and generate the triggers only if so desired by the user.
Send your changes to liron.levi@gmail.com and I'll ask the moderates at codeproject to update the article.
Thanks in advance Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for this great program. I have one table that have two integers and one of them was primarykey. In my application I used dataset relation. When I converted to sqlite:
- the primarykey was converted to INTEGER - but the second integer left as INT. This causes the dataset relation to throw the following exeption:
Parent Columns and Child Columns don't have type-matching columns
I used the sqlite manager and change the second value to INTEGER and it works
My dataset: ds.Relations.Add("rel", ds.Tables("Menus").Columns("ParentID"), ds.Tables("SubMenu").Columns("ChildID")) ParentID and ChildID in the same table.
I was wondering if all sql2005 INT should be converted to INTEGER
Thanks
Gammash
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi
Can you please send me a sample SQL Server database file (with minimal data or schema only) so I can check this on my machine? Send the file to liron.levi@gmail.com
Thanks Liron Levi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Let me first say this program is incredibly fast.
Only thing I noted so far was that in location where I had IDENTITY(1,1) on decimal values in the MS_SQL tables, they weren't added as AUTOINCREMENT by the tool. Not sure if that was intentional or not, but I thought I'd mention it. This was an existing database and maybe they should have used int instead of decimals for the primary key.
Sam
modified on Monday, March 16, 2009 1:02 PM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Sam
SQLite allows the AUTOINCREMENT feature only on INTEGER fields. This is why the converter can't apply the AUTOINCREMENT algorithm when converting from SQL Server decimal primary key columns. So this was intentional (it should have been anyway - my memory is rapidly deteriorating these days )
BTW: if you need to support easy SQLite database upgrades you may want to check another article I wrote in codeproject (search for "sqlite upgrade").
Best regards Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Using the latest code, 1.9, I was importing a small database from SQL Server and it aborted on datetime objects. I saw in the code other places where datetime was taken into account. What I changed was...
SqlServerToSQLite.cs in GetDbTypeOfColumn() line 365...
if(cs.ColumnType == "timestamp" || cs.ColumnType == "datetime")
...basically added the || clause. I have imported several other DBs for far some with nearly 1 million rows in a table, with datatime objects, and all is well...
Other than that excellent work...it is greatly appreciated...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |