Voglio "collegare" un server SQLite con un server SQL Server 2008. Ad esempio usando il sp_addlinkedserver
comando. Come faccio a fare questo?
Ho cercato in lungo e in largo, ma non ho trovato alcuna soluzione a questo problema. Il tentativo più vicino che ho trovato è qui:
http://www.sqlservercentral.com/Forums/Topic866972-149-1.aspx
--#################################################################################################
--Linked server Syntax for SQLite
--using OLE provider C:\Program Files\Cherry City Software\SQLiteProvider\SQLitePV.dll
--from http://cherrycitysoftware.com/ccs/Download/Download.aspx
--#################################################################################################
DECLARE @server sysname,
@srvproduct nvarchar(256),
@provider nvarchar(256),
@datasrc nvarchar(100),
@location nvarchar(100),
@provstr nvarchar(100),
@catalog sysname,
@sql varchar(1000)
--add an SQLite Database as a linked server
SET @server = N'mySQLite'
SET @srvproduct = N'SQLite Provider'
SET @provider = N'OleSQLite.SQLiteSource.1'
SET @datasrc = N'C:\Data\LowellSSC.db3'
set @provstr = ''
EXEC sp_addlinkedserver @server,@srvproduct,@provider,@datasrc,NULL,@provstr
exec sp_addlinkedsrvlogin @rmtsrvname='mySQLite',
@useself = N'false',
@locallogin = NULL,
@rmtuser = N'Admin',
@rmtpassword = NULL
--list all the tables and their names
EXEC sp_tables_ex 'mySQLite'
--above fails with this error:
--Msg 7302, Level 16, State 1, Procedure sp_tables_ex, Line 41
--Cannot create an instance of OLE DB provider "OleSQLite.SQLiteSource.1" for linked server "mySQLite".
GO
EXEC dbo.sp_DropServer 'mySQLite', 'DropLogins'