Consider two special request objects (both available on tape) in MS Access:
- A pass-through request that allows you to save the SQL Server syntax of the connected BackEnd, but executed from within MS Access; To do this, you need to specify the ODBC / OLEDB settings at creation.
- Request a Make-Table action to create a local access table from above through a request.
Pass Request
(saving as a stored, end-to-end query object, slightly adjusted CTE to the view, but CTE cannot work for no reason)
SELECT [Tour number], [TISLOT Time slot begin], [TISLOT Delivery day], [Gate], [Gate XML].value('/M[1]', 'varchar(50)') As [Gate1], [Gate XML].value('/M[2]', 'varchar(50)') As [Gate2], [Gate XML].value('/M[3]', 'varchar(50)') As [Gate3], [Gate XML].value('/M[4]', 'varchar(50)') As [Gate4], [Gate XML].value('/M[5]', 'varchar(50)') As [Gate5], [Gate XML].value('/M[6]', 'varchar(50)') As [Gate6], [Gate XML].value('/M[7]', 'varchar(50)') As [Gate7], [Gate XML].value('/M[8]', 'varchar(50)') As [Gate8], [Gate XML].value('/M[9]', 'varchar(50)') As [Gate9], [Gate XML].value('/M[10]', 'varchar(50)') As [Gate10] FROM ( SELECT [Tour number], [TISLOT Time slot begin], [TISLOT Delivery day], [Gate], CAST('<M>' + REPLACE([Gate], ',' , '</M><M>') + '</M>' AS XML) AS [Gate XML] FROM dbo.TISLOT ) AS dT
Make-Table Query
(an action request can be run once or saved as a stored request object for regular use)
SELECT * INTO [NewMSAccessLocalTable] FROM [SQLServerPassThruQuery]