Team, I am using below query to export SQL table data to excel, but I am getting a syntax error as below. Kindly help to resolve this as soon as possible.
Incorrect syntax near ' '.
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;
Database=\\local\testlocation\users$\Documents\test.xlsx','SELECT * FROM [Sheet1$]')
SELECT * FROM Test_Date
SQL Server version - SQL SERVER 2008 R2, 64bit