Skip to content

Instantly share code, notes, and snippets.

Last active April 2, 2017 22:17
What would you like to do?
Get current username in Power Query via LocalDB or SQL Server
UserNameLocalDB =
() => Sql.Database("(localdb)\v11.0","",[Query="SELECT SYSTEM_USER"])
//LocalDB from SQL Server 2016 Express
UserNameLocalDB2016 =
() => Sql.Database("(localdb)\MSSQLLocalDB","",[Query="SELECT SYSTEM_USER"])
//Local instance of SQL Server
UserNameSQL =
() => Sql.Database(".","",[Query="SELECT SYSTEM_USER"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment