0
我該如何使用Microsoft.ACE.OLEDB.12.0來做到這一點?如何使用sql查詢從Excel中填充SQL Server表?
CREATE TABLE [dbo].[Addresses_Temp] (
[FirstName] VARCHAR(20),
[LastName] VARCHAR(20),
[Address] VARCHAR(50),
[City] VARCHAR(30),
[State] VARCHAR(2),
[ZIP] VARCHAR(10)
)
GO
INSERT INTO [dbo].[Address_Temp] ([FirstName], [LastName], [Address], [City], [State], [ZIP])
SELECT [FirstName], [LastName], [Address], [City], [State], [ZIP]
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\Source\Addresses.xlsx;IMEX=1',
'SELECT * FROM [Sayfa1$]')
我該怎麼做?
你是否試圖直接從sqlserver做到這一點? – Gratzy 2010-06-11 15:06:28