I'm new to SQL, trying to query an Azure SQL Database (Adventureworks sample) using PowerShell's Invoke-SQLCmd.
When I try the following command in Powershell:
Invoke-Sqlcmd -Query "SELECT * FROM SalesLT.Customer;" -ServerInstance
"<servername>.database.windows.net" -Username <username> -Password <password>
I get:
Invoke-Sqlcmd : Invalid object name 'SalesLT.Customer'.
Do I need to specify what Database that table is under? Namely, "SQLDatabse" instead of "master"? But when I add Use SQLDatabase to my query it throws another error:
USE statement is not supported to switch between databases. Use a new
connection to connect to a different database.
Note: Executing these queries from SQL Server Management Studio gets me the table with no errors.