EXEC sp_configure 'show advanced options', 1; GO RECONFIGURE; GO EXEC sp_configure 'Ad Hoc Distributed Queries', 1; GO RECONFIGURE; go INSERT INTO [sqlDb].[dbo].[pages]([page_title],[model_name],[page_num]) SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\MF 240\Excel file\b.xls;IMEX=1;HDR=YES','select [Sub Group Name],[Model],[pagenum] from [Sheet1$]')
Msg 207, Level 16, State 1, Line 5 Invalid column name 'page_title'.
pages
page_title
Page_Title
INSERT INTO [sqlDb].[dbo].[pages]([page_title],[model_name],[page_num])SELECT [Sub Group Name] AS [page_title],[Model] AS [model_name],[pagenum] AS [page_num]FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\MF 240\Excel file\b.xls;IMEX=1;HDR=YES','select [Sub Group Name],[Model],[pagenum] from [Sheet1$]')
INSERT INTO [dbo].[pages]([page_title],[model_name],[page_num])
SELECT
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)