How can we help you today? How can we help you today?

Deploy making undesired change to code where there wasn't a difference

when i create or alter an object and have the object name on the following line to the create or alter part on both sides of the comparison identically once i deploy the change (which is further within the procedure itself) when the databases re-compare i now have a difference which i didn't have before where the object name is in the same line as the ALTER part

 

james.strath
0

Comments

2 comments

  • Christian Perez
    Official comment

    Hi James,

    Thanks for reaching out to Redgate Support regarding your issue with SQL Compare. What version of the product are you using in this case? For testing purposes, would you be able to share the exact T-SQL you are using? I should be able to replicate the behavior once I know the version and syntax.

    Christian Perez
  • james.strath

     

    RedGate.SQLCompare.UI.exe

    C:\Program Files (x86)\Red Gate\SQL Compare 15

    15.4.10.27977+6a233340b701adde9321bff7be3c47314fc3b733

    4.0.30319.0

    False

    Thanks Christian- apologies, I should know by now that it would be useful to include these each time on a ticket! - Also that would prompt me to do what i normally do when i encounter a possible issue and update the software to see if it's been resolved already. 

    I will probably update later today

     

    i have a simple proc on both databases

    i make a trivial change to force a difference

    I go to deploy and the script include my intended change but as a consequence changes the first line

    so following the deployment it shows as no difference between the two databases 

    but an unintended change has occurred - which means i have to correct it manually afterwards (which is tedious when it surprises you and amends multiple items) and it shows up as every object different when using a different compare tool (Eg devops)
     

    script for the simple proc to be precisely like mine - but it happens on any proc, object you write

    CREATE OR ALTER
    PROC [dbo].[proc]
    AS
    ;BEGIN
    ;SET NOCOUNT ON
    ;BEGIN TRY
    ;DECLARE @this_proc_name sysname = (CONCAT((QUOTENAME(OBJECT_SCHEMA_NAME(@@PROCID))), (CHAR(46)), (QUOTENAME(OBJECT_NAME(@@PROCID)))))
        ;DECLARE @RC INT = (0)

        ;RAISERROR(@this_proc_name, 10, 0)WITH NOWAIT

    ;END_OF_QUERY:

        ;RETURN(@RC)

    END TRY
    BEGIN CATCH

        ;DECLARE @ErrorMessage NVARCHAR(MAX) = (ERROR_MESSAGE())
        ;RAISERROR(@ErrorMessage, 16, -1)
        ;RETURN(ERROR_NUMBER())

    END CATCH

    END --of sp
    GO
     

    james.strath
    0

Add comment

Please sign in to leave a comment.