Excel Populate Power Query Temp Table with Worksheet Parameter Table Values

Copper Contributor

Greetings, 

      I'm trying to populate a Excel Power Query sql temp table with all values listed in a worksheet table.

Here is my Power Query referencing a worksheet table, the values in the table are not being pulled into the query.

AcctingItem = Excel.CurrentWorkbook() {[Name="AcctItem"]}[Content]{0}[ACCT_ITEM], AcctItem = Text.From( AcctingItem ),
AcctingBucket = Excel.CurrentWorkbook() {[Name="AcctItem"]}[Content]{0}[ACCT_BUCKET], AcctBucket = Text.From( AcctingBucket ),

= Sql.Database("MyServer", "MyDatabase", [Query="BEGIN TRY DROP TABLE #accbucket END TRY BEGIN CATCH END CATCH#(lf)CREATE TABLE #accbucket#(lf)#(tab)(#(lf)#(tab)ACCT_ITEM CHAR (3) NOT NULL, #(lf)#(tab)ACCT_BUCKET VARCHAR (50) NOT NULL#(lf)#(tab))INSERT INTO #accbucket#(lf)( ACCT_ITEM, ACCT_BUCKET )#(lf)VALUES('" & AcctItem & "','" & AcctBucket & "')

 

Any assistance is greatly appreciated.

0 Replies