I've installed Office 2007 Data Connectivity Components and Access Database Engine 2010 Redistributable on the server. I've created the following stored procedure and can execute it successfully in SSMS on the server.
CREATE PROCEDURE [dbo].[usp_POLineFollowUpStaging_Insert]
(
@File VARCHAR(100) = NULL
)
AS
SET NOCOUNT ON
DECLARE @SQL VARCHAR(2000)
SET @SQL =
'SELECT *
FROM OPENROWSET(''Microsoft.ACE.OLEDB.12.0''
, ''Excel 12.0;Database=\\domain\FilePath\' + @File + ';''
, ''SELECT * FROM [Sheet1$]'')'
EXEC(@SQL);
However, when I try to execute this procedure in SSMS on a client it fails. I would like to understand why it fails when run on a client. I'm guessing it's because Office 2007 Data Connectivity Components and Access Database Engine 2010 Redistributable are not installed on the client. Since the procedure, components, and redistributable are all on server I thought it would work.
Kevin