Martinl
New member
- Joined
- Dec 2, 2016
- Messages
- 15
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- 2016 MSO (16.0.9126.2259)
Hi
I picked up some code a few years ago to pull in SQL data using a parameter table in EXCEL
This worked quite happily until we decided to move outr server to the cloud and changed server names.
I thought that the change would be quite simple
Go to the table and change the server name and hey presto.
But no...I get nothing back.
I have check the parameters
dbServer CORRECT
dbName CORRECT
dbQuery CORRECT
If I click on each of these parameters in Power Query they all bring back the correct information but the Source line returns nothing and I cant understand why
By going to SQL the Query line reports as expected - so what am I missing?
this is my code
let
//Pull in a values from the parameter table
dbServer = fnGetParameter("Server"),
dbName = fnGetParameter("Database"),
dbQuery = fnGetParameter("SQL Statement"),
//Get the data
Source = Sql.Database(dbServer,dbName,[Query=dbQuery]),
in
#"Source"
I picked up some code a few years ago to pull in SQL data using a parameter table in EXCEL
This worked quite happily until we decided to move outr server to the cloud and changed server names.
I thought that the change would be quite simple
Go to the table and change the server name and hey presto.
But no...I get nothing back.
I have check the parameters
dbServer CORRECT
dbName CORRECT
dbQuery CORRECT
If I click on each of these parameters in Power Query they all bring back the correct information but the Source line returns nothing and I cant understand why
By going to SQL the Query line reports as expected - so what am I missing?
this is my code
let
//Pull in a values from the parameter table
dbServer = fnGetParameter("Server"),
dbName = fnGetParameter("Database"),
dbQuery = fnGetParameter("SQL Statement"),
//Get the data
Source = Sql.Database(dbServer,dbName,[Query=dbQuery]),
in
#"Source"