Forum Discussion
Million_queries
Dec 13, 2021Copper Contributor
Invoke-sqlcmd throws login failed error
Hello, I am not able to figure out why invoke-sqlcmd is not working. It’s giving login failed error.. When the azure release pipeline runs, if the database does not exist then it restores the new da...
Million_queries
Dec 13, 2021Copper Contributor
I was able to resolve this issue. I was calling the database name in the invoke-sqlcmd which it did not like. Somebody replied in another forum and it resolved my issue. below command solved my problem invoke-sqlcmd -ServerInstance $server -Database master -Username $sqlusername -Password $sqlpassword -Query $sql Earlier i was using $dbname instead of master