How does one go about viewing a .bak file when they script out a backup command? For example when I run a script that has this SQL in it:
DECLARE @database NVARCHAR(75) = 'MyDatabase';
DECLARE @filename NVARCHAR(75) = 'C:\temp\MyDatabase.bak';
BACKUP DATABASE @database
TO DISK = @filename;
I get a message saying that backup was complete, however, I can't go to the location and view the .bak file. SSMS can pickup that it's there when I restore from device > file, but I can't view the file either in the window explorer or PowerShell prompt. How can one see the backup file that's being created?
Edit
The database is a local MS SQL Server Express running inside of a docker container. I think that should still act like the normal instance of SQL Server, but maybe someone can explain how it differs.