Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Standard Report Error 'Incorrect Syntax' When Running Via PowerShell

$
0
0

Hi all,

We're currently using SQL Server Express that has a 10GB limit, and we're looking to automate the generation of the 'Disk Usage by Top Tables' standard report found within SQL Server Management Studio.

Using Telerik's JustDecompile, I managed to find the SQL for the standard report in the file 'Disk_Usage_Top_Objects.rdlc'. I've saved this as a variable within PowerShell.

However, when going to run it with the following command:

Powershell
Invoke-Sqlcmd-Query$SQLQquery-ServerInstance"Titian13\VEEAMSQL2012"-Database"VeeamBackup"

I receive the error:

Powershell
Anexpressionofnon-booleantypespecifiedinacontextwhereaconditionisexpected,near';'.Incorrectsyntaxnear';'.Incorrectsyntaxnearthekeyword'AS'.Msg4145,Level15,State1,Procedure,Line10.

I'm not sure why it'snotworking, considering it's...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>