At one point a few years ago I setup a project in Visual Studio to output to an Azure SQL V12 database, and tried to use `sqlcmd` with migration scripts (I say this also to point out that at one point everything did work, and everything discussed below made it into production).

My postdeployment script looks something like this:

```
PRINT N'Starting post deployment';
:setvar WorkDirectory "F:\path\to\scripts"
PRINT N'Starting 1.01';
:r $(WorkDirectory)\1.01\Deployment.sql
PRINT N'Starting 1.02';
:r $(WorkDirectory)\1.02\Deployment.sql
PRINT N'Starting 1.03'; :r $(WorkDirectory)\1.03\Deployment103.sql
PRINT N'Starting 1.04'; :r $(WorkDirectory)\1.04\Deployment104.sql

```

After not making any changes to the project (not consciously anyway), I've discovered that when I try and debug/generate the database and apply the migration scripts, I get an error because a column is referenced that doesn't exist on the table. The following is the offending part from the `Deployment104.sql` file:

```
IF NOT EXISTS (SELECT *
               FROM sys.columns 
               WHERE Name = N'MissingColumn'
                 AND Object_ID = Object_ID(N'TableA'))
BEGIN
    ALTER TABLE TableA 
        ADD MissingColumn INT NOT NULL
END
GO

IF NOT EXISTS (SELECT 1 
               FROM information_schema.Routines
               WHERE ROUTINE_NAME = 'LIST_CODES'
                 AND ROUTINE_TYPE = 'PROCEDURE' 
                 AND ROUTINE_SCHEMA = 'dbo' )
BEGIN;
    EXEC('CREATE PROCEDURE dbo.LIST_CODES as set nocount on;')
END
GO

ALTER PROCEDURE [dbo].LIST_CODES 
AS
    SELECT * 
    FROM CodesTable ct 
    LEFT JOIN TableA ta ON ct.CodeId = ta.CodeId
    WHERE ta.MissingColumn= 1999
    ORDER BY ct.CodeId
GO

```

The Db ends up partially created at this point. However, when I run that first check for whether the column exists, I actually get an entry back, implying that the column does exist in TableA. And yet I don't see it in Server Explorer (VS 2019 preview 16.4), and obviously the next part of the script doesn't see it either.

What am I doing wrong, and/or how can I make the script and the db agree as to which columns exist and which do not?

EDIT: as an update, while running the PostDeploymentScript fails, running the problematic script itself (Deployment104 in this case) works just fine, after which both the column and the stored procedure show up exactly as expected in the server explorer and can be referenced by other queries.