Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Import data from SQLite database into SQL server 2008 Database.


Import data from SQLite database into SQL server 2008 Database.

Author
Message
dharmabhushan
dharmabhushan
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 59
Hi

I have to Import/Export data between SQLite and SQL server 2008 databases OR I want to convert SQL Sever 2008 database to SQLite database. Can u pls guide me how to do it?

Dharmabhushan
Robin Sasson
Robin Sasson
Right there with Babe
Right there with Babe (769 reputation)Right there with Babe (769 reputation)Right there with Babe (769 reputation)Right there with Babe (769 reputation)Right there with Babe (769 reputation)Right there with Babe (769 reputation)Right there with Babe (769 reputation)Right there with Babe (769 reputation)

Group: General Forum Members
Points: 769 Visits: 530
As a data migration task, you'll have some planning to do to ensure data types between the two systems are compatible, especially dates.

You can export data from SQL 2008 in a variety of ways, the easiest being by right-clicking on a database in SQL Management Studio and left-clicking on Export Data or Tasks > Generate Scripts.

Hopefully that will get you started but come back to us if you need further help.

Exclamation "Be brave. Take risks. Nothing can substitute experience." Exclamation
Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14959 Visits: 38977
i've done this in vb.Net / C#.Net; let us know if you are a programmer and just need a deeper code example.
once i had the reference to System.Data.SQLite it's really easy.


Dim f As String = Application.StartupPath & "\" & "Stormrage.SQLite.db3"

'delete so we can test the whole process:
If File.Exists(f) Then
File.Delete(f)
End If

Dim SQLconn As New System.Data.SQLite.SQLiteConnection()
Dim SQLcommand As SQLiteCommand
Dim sql As String
'create database if it does not exist
Try
If Not File.Exists(f) Then
Dim SQLconnect As New System.Data.SQLite.SQLiteConnection()
'Database Doesn't Exist so Created at Path
SQLconnect.ConnectionString = "Data Source=" & f & ";"
SQLconnect.Open()
SQLconnect.Close()
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Try
'now the file exists, lets add some tables.
SQLconn.ConnectionString = "Data Source=" & f & ";"
SQLconn.Open()
SQLcommand = SQLconn.CreateCommand
''drop all the tables if they exist:
'Dim SchemaTable As New DataTable
'SchemaTable = SQLconn.GetSchema(SQLiteMetaDataCollectionNames.Tables, {"NEXUSLEVELS"})
'For int As Integer = 0 To SchemaTable.Rows.Count - 1
' If SchemaTable.Rows(int)!TABLE_TYPE.ToString = "table" Then
' sql =
' End If
'Next
'> create table t (
'> a varchar(15) check (length(a) <= 15),
'> b integer check (typeof(b) = 'integer')
sql = "CREATE TABLE [SQLiteDevelopers] ( " & vbCrLf
sql = sql & "[DeveloperID] INTEGER IDENTITY(1,1) NOT NULL, " & vbCrLf
sql = sql & "[DeveloperName] VARCHAR(50) NOT NULL, " & vbCrLf
sql = sql & "[DeveloperType] VARCHAR(30) NULL DEFAULT 'EVIL', " & vbCrLf
sql = sql & " PRIMARY KEY (DeveloperID), " & vbCrLf
sql = sql & " CHECK ([DeveloperType] = 'EVIL' OR [DeveloperType] = 'GOOD' OR [DeveloperType] = 'NEUTRAL') ) " & vbCrLf
sql = sql & " " & vbCrLf
SQLcommand.CommandText = sql
SQLcommand.ExecuteNonQuery()



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search