I am still trying to learn/teach myself sql. I am adjusting a SCOM dashboard but 1 query gives an error. I am not sure why. I asked my DBA and he said for me to ask google. I get incorrect syntax near "server name\instance" expecting '(' or select at sql.Database("OPSMGR2016DW\OPSDBDW" I tried but still cannot figure it out. the full statement is:
let
Source = Sql.Database("OPSMGR2016DW\OPSDBDW", "OperationsManagerDW", [Query="SELECT DISTINCT DB_NAME(dovs.database_id) DBName,#(lf)mf.physical_name PhysicalFileLocation,#(lf)dovs.logical_volume_name AS LogicalName,#(lf)dovs.volume_mount_point AS Drive,#(lf)CONVERT(INT,dovs.available_bytes/1048576.0) AS FreeSpaceInMB#(lf)FROM sys.master_files mf#(lf)CROSS APPLY sys.dm_os_volume_stats(mf.database_id, mf.FILE_ID) dovs#(lf)Where DB_NAME(dovs.database_id) LIKE '%OperationsManager%'"]),
#"Renamed Columns" = Table.RenameColumns(Source,{{"DBName", "DB Name"}, {"PhysicalFileLocation", "Physical File Location"}, {"LogicalName", "Logical Name"}, {"FreeSpaceInMB", "Free Space (MB)"}})
in
#"Renamed Columns"
Please point me in the direction of what the proper format is.
I also get the same thing in the area of Table.RenameColumns(Source,{ of incorrect syntax near 'Source'. Expecting '(' or Select