I want to export or import from MSDE 200 Rel A to Access2003/2000. How can I
do ? Thank alot
hi Quang Hanh,
Quang Hanh wrote:
> I want to export or import from MSDE 200 Rel A to Access2003/2000.
> How can I do ? Thank alot
you can have a look at sp_addlinkedserver system stored procedure...
you can add a linked server pointing to the Access database like following,
where a pesudo copy of the original JET table is created an populated from
the original data
SET NOCOUNT ON
USE master
GO
-- adding linked server
EXEC sp_addlinkedserver
@.server = 'my_JET_db',
@.provider = 'Microsoft.Jet.OLEDB.4.0',
@.srvproduct = 'OLE DB Provider for Jet',
@.datasrc = 'D:\NWIND.MDB' -- point to Nortwind JET database
GO
-- use your database.. here just define a new table in tempdb
USE tempdb
GO
CREATE TABLE dbo.MSDE_customers (
CustomerID VARCHAR(60) PRIMARY KEY ,
CompanyName VARCHAR(60) ,
ContactName VARCHAR(60) ,
ContactTitle VARCHAR(60) ,
Address VARCHAR(60) ,
City VARCHAR(60) ,
Region VARCHAR(60) ,
PostalCode VARCHAR(60) ,
Country VARCHAR(60) ,
Phone VARCHAR(60) ,
Fax VARCHAR(60)
)
GO
PRINT 'SELECT from the linked server Jet database'
SELECT TOP 10 * FROM my_JET_db...Customers
PRINT 'Import rows to the MSDE database via INSERT INTO'
INSERT INTO dbo.MSDE_customers SELECT * FROM my_JET_db...Customers
PRINT ''
PRINT 'SELECT from the MSDE database'
SELECT TOP 10 * FROM dbo.MSDE_customers
GO
-- cleanup
DROP TABLE dbo.MSDE_customers
GO
USE master
go
EXEC sp_dropserver 'my_JET_db', 'droplogins'
further information and relative synopsis about sp_addlinkedserver system
stored procedure can be found at
http://msdn.microsoft.com/library/de..._adda_8gqa.asp
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
sql
No comments:
Post a Comment