Odd issues - alter procedure not changing procedure

  • I'm trying to change references to a fully qualified object to a semi qualified in a stored procedure. I execute the alter procedure statement, it runs fine. When I open the source code for the stored procedure, the fully qualified object reference is still there.

    SELECT columns

    FROM [DB1].[dbo].[table1] t1

    JOIN [DB1].[dbo].[table2] t2

    ON t1.id = t2.id

    to

    SELECT columns

    FROM [dbo].[table1] t1

    JOIN [dbo].[table2] t2

    ON t1.id = t2.id

  • Only reason I can think of for this would be you're either pointing at the wrong db or the wrong schema. I've never seen an alter successfully run but not update the proc.


    And then again, I might be wrong ...
    David Webb

  • Totally agree. I'm right-clicking 'Modify' - > making changes in query window -> execute -> Modify again to verify. This is strange.

  • I just tried it in a different database and it worked fine...

  • It's unlikely to be the reason in this case, but a server-level DDL trigger could probably make this happen.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Maybe caching at the client, try a refresh... grasping at straws here. I've only ever seen it work.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Just for fun, you could also try DROP/CREATE.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • I tried drop/create for laughs, still the same. I have a few databases on a local instance that I use for dev purposes, different branches if you will and have been keeping them in sync using openDBDiff. I wonder if applying changes via this software had anything to do with it. I'm looking through their open issues now.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply