|
 |
|
|
Error: If regional settings is Turkish , Application can not find information_scheme.
Solution: You must change to uppercase "INFORMATION_SCHEMA" text in SqlServerToSQLite.cs
Future Request : Can you add convert support for Views?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Mustafa
I'm currently swamped with work so I'll probably get to this later next week. I'll check Views support and if its not too much work I'll probably add it to the next version.
Thanks for the bugfix. I'll include it in the next version.
Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
When I try this it says "Could not load file or assembly 'System.Data.SQLite, Version 1.0.48.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format."
Any advice would be greatly appreciated. I'm probably missing something obvious.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
After messing around with everything I could think of, I switched over to XP, and sure enough, worked like a charm. Great code - it was fun to look through. Thank you very much for the contribution. As for Vista... I want to like it, really... but that's for another time and place. Again, thanks!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Great!
Nice to know it helps. If you have any problem or question - don't hesitate to ask.
Liron (liron.levi@gmail.com)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I've just been tasked with creating a data abstraction layer to allow our existing SQL Server code to work with SQLite.
This is exactly what I was looking for to get a 'copy' of my SQL Server database into an SQLite database.
Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Great
If you have any problems - send me the logs and I'll provide a fix asap.
Note: the utility does not currently handle SQL Server stored procedures or views. I plan to add support for views soon. Stored procedures are not supported in SQLite to the best of my knowledge.
Liron (liron.levi@gmail.com)
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I'm new to SQLite so maybe these suggestions are wrong but here goes:
1) SQL Server data types aren't converted to base SQLite data types. i.e. (bit -> bit) not to integer. There is no bit data type in SQLite correct?
2) Foreign keys from SQL Server table show up as Primary keys in SQLite table (at least that is what SQLite Mangager tells me).
Thanks,
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi lushdogg
Some points that may interest you:
SQLite does not mind that you declare a field as BIT. It treats it as a general purpose field (SQLite has a very loose type-system - you can store any value in any field). It does not enforce it to be boolean though. This is up to you (which is unfortunate IMO but that's the way it is). In my code I insist that boolean fields only store 0 (for FALSE) or 1 (for TRUE) and nothing else.
I could convert any boolean field to an INTEGER field but then I would lose the ability to drag the generated table to the VS.NET designer and see it declared as a boolean field automatically.
So converting BIT fields from SQL Server to BIT fields in SQLite seems to be the optimal choice even though there is no actual BIT type in SQLite...
To the best of my knowledge - SQLite does not support foreign keys at all. I cannot do anything with that information when converting from SQL Server to SQLite (and it is not the only type of information that gets lost in the process unfortunately).
Liron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Now the utility knows how to convert from SQL Server's GETDATE() function usage in DEFAULT clause to SQLite CURRENT_TIMESTAMP clause.
For example, in SQL Server you could write:
CREATE TABLE test ( datetime CreateDate DEFAULT (GETDATE()) )
which will cause SQL Server to insert the current time as the default value for the [CreateDate] column.
Now - it will be translated to SQLite's equivalent:
CREATE TABLE test ( timestamp CreateDate DEFAULT (CURRENT_TIMESTAMP) )
Hope it helps 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Just added support for GETDATE function which appears in DEFAULT clause of CREATE TABLE DDL. For example:
CREATE TABLE xxx ( datetime CreateDate DEFAULT (GETDATE()) )
is now translated to SQLite as
CREATE TABLE xxx ( timestamp CreateDate DEFAULT (CURRENT_TIMESTAMP) )
Hope it helps
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
When I tried to convert a database, the conversion failed with the following error:
... AddSQLiteTable failed System.Data.SQLite.SQLiteException: SQLite error default value of column [CreateTime] is not constant at System.Data.SQLite.SQLite3.Prepare(String strSql, SQLiteStatement previous, String& strRemain) at System.Data.SQLite.SQLiteCommand.BuildNextCommand() at System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index) ...
Any idea about the cause? Thanks!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
SQLite does not support using functions to provide for default values. In your specific case - I guess you've used such an SQL Server function to provide default date. Something like:
datetime [CreateTime] DEFAULT (GETDATE())
In the CREATE TABLE clause for the DB table.
Until version 3.1.0 this was totally unsupported in SQLite. If you are using SQLite version 3.1.0 or above - you may be able to use a modified version that I'll upload shortly to codeproject which uses CURRENT_TIMESTAMP as the default value whenever it detects a GETDATE function.
If you did something else - please let me know what was the original SQL Server schema so I can know for sure the cause for the problem.
Liron
(liron.levi@gmail.com)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
The object 'Result' does not exist in database 'xxx' or is invalid for this operation.
Need I create a table before?
Saludos Al
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I've updated the converter solution to include logging information. I'll be grateful if you can download it, run it again on your DB and send me the logs so I can check this further.
The log files will be placed under the bin/Debug/Logs directory of the application.
Thanks in advance
Liron (email logs to liron.levi@gmail.com)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Oh - strange... it should have logged the error in the log file - it works in my computer
If you can send me a BAK file of your DB I'll probably be able to help you out anyway (even an empty one).
Cheers Liron (liron.levi@gmail.com)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Show us what you did.
This is supposed to be an article.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
| Sign In·View Thread·PermaLink | 3.75/5 (5 votes) |
|
|
|
 |