thanks. I finally figure out the issue
it's should be some syntax problem. Thanks
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I would like to use invoke-sqlcmd in azure automation account . using option -query
I declare a query (multi line query)
$query = @'
declare @var1 varchar(10)
declare @var2 varchar(10)...... and some other TSQL
'@
then
invoke-sqlcmd -ServerInstance "servername" -Database "dbname" -Credential $SQLServerCred -Query "$Query" -Encrypt
however it's failed to run the job .
why ??
I don't want to use store procedure , as I will need to create the same store procedure at different Azure sql database .
any other possible solution ?
thanks. I finally figure out the issue
it's should be some syntax problem. Thanks