Forum Discussion
Anonymous
6 years agoNot applicable
Use list of values as input to SQL query
Hi, I have a list of databases that is generated from a SQL query: let
Source = Sql.Database(Server, "master", [Query="SELECT name FROM master.dbo.sysdatabases"])
in
Source The list is ...
JosefPrakljacic
6 years agoSolution Sage
Hey Anonymous ,
here is a helpful blog article. The principle is the same I would say.
If this post was helpful may I ask you to mark it as solution and give it a 'thumbs up'? This will also help others
Have a nice day!
BR,
Josef
Graz - Austria
- Anonymous6 years agoNot applicable
Thanks for your reply.
The have problems when I try to authenticate against the server when I try to replace the value of the database name and instead point towards the list of databases
The query looks like this:
let Source = Sql.Database(Server, "&dbQueryList&", [Query="select count (*), datepart (day, completed) as day,datepart (hour, completed) as hr from ChannelMessageHistory#(lf)where completed >= getdate()-1#(lf)group by datepart (day, completed), datepart (hour, completed)--, method#(lf)order by datepart (day, completed), datepart (hour, completed)--, method#(lf)"]) in SourceIt will then try to login to an database with the name of "&dbQueryList&" which off cource doesnt work. How do I write the query to reference back to the list?