Script verification failing with different server/db name

catalogdbcatalogdb Posts: 16 New member
edited November 14, 2019 1:43PM in SQL Change Automation
Hi,

I updated one of the stored procedure on dev db and tried to refresh the SCA solution to reflect this change. But weirdly, I am getting script verification failed error in the baseline script. The error is basically saying the stored procedure creation was failing because its already exists which is obvious because all baseline objects already exists and I was not expecting SCA to use baseline script to rebuild the DB especially when everything is already (marked) as deployed and also when I have already marked "First folder as baseline folder" option in the project properties.

Biggest surprise to me is that the log is showing different server name (in azure which I can't share) and also different db name (LOCALDB#FD448B34, this not even exist) which I am not using. No matter how much I try the server name in the log message  (not on the SCA tab in VS) always shows a different server name which I not even used for SCA but just added server node in the VS server explorer.

Why SCA error log showing different serverdb/db? Why it is trying to run baseline script? Please help.

Answers

  • The Baseline will be deployed if one of the following occurs:

    1 - The target database doesn't have any user objects
    or
    2 - The __Migrationlog table exists (this table records migrations applied) and the Baseline is not marked as deployed in it
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • catalogdbcatalogdb Posts: 16 New member
    Hi Sergio,

    I don't think that's the issue because I can confirm that the baseline script was marked as deployed already. Two other important points which I could not understand. I created a new folder and pulled the code from repo, that did not gave this issue. Same code without any change. That's first.
    Second, why the error log is showing different server name and db name which I was haven't pointed to. I connected to on-prem sql server and the error log was showing azure server name which I didn't even connected.
  • I am unsure why that would happen, we'd need more troubleshooting data: logs and possibly the project. I am going to contact you directly to troubleshoot this further.
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • catalogdbcatalogdb Posts: 16 New member
    Hi Sergio,

    I can't share project but I can share logs. But the 9 line log file doesn't have much information. Are there any detailed logs created somewhere else?

    -- Log (changed server name and couple of table names)
    ...stionMPExclusion]
    Creating [dbo].[MPCAS]
    Creating primary key [PK_MPCAS] on [dbo].[MPCAS]
    Creating [dbo].[GetMPF]
    Creating [dbo].[UserIdIssuer]
    Creating primary key [PK_UserIdIssuer] on [dbo].[UserIdIssuer]
    Creating [dbo].[GetNewUserId]
    Msg 2714, Level 16, State 3, Server X12-NG-XXXX022D\LOCALDB#D59D025F, Procedure GetNewUserId, Line 1
    There is already an object named 'GetNewUserId' in the database.

    Baseline script marked as deployed

    Let me know if you need any further details
  • SQL Change Automation logs can be found at %LocalAppData%\Red gate\SQL Change Automation
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • catalogdbcatalogdb Posts: 16 New member
    All it has is this single empty json file.
  • catalogdbcatalogdb Posts: 16 New member
    edited December 5, 2019 11:12AM
    Good news that this issue appears to be have magically gone now. Bad news is no clue what happend but I am suspecting my fresh reinstallation of SCA plugin did something. Bug again, surprisingly with no changes except that I closed and reopned solution multiple attempts.
Sign In or Register to comment.