Build doesn't see schema changes
Daulet
Posts: 3
Hello,
I have the database called MyDB. In it I have a table MyDB.cfg.App_Module. I made a change in that table to add SecurityAdmin column. In the same changeset (I use TFS) I changed a stored proc to use SecurityAdmin column. When I ran it DLM Build give me this error:
I checked that the same changeset has changes for the table and the stored proc. Here is log lines that confirms that the table was created before stored proc update.
How to see the script that SQL Compare uses to update/validate DB? Where can I find source code of Invoke-DlmDatabaseSchemaValidation? What might be the source of the problem?
I have the database called MyDB. In it I have a table MyDB.cfg.App_Module. I made a change in that table to add SecurityAdmin column. In the same changeset (I use TFS) I changed a stored proc to use SecurityAdmin column. When I ran it DLM Build give me this error:
[11:44:28][Step 1/3] WARNING: The error 'Invalid column name 'SecurityAdmin'.' occurred when [11:44:28][Step 1/3] executing the following SQL: --- [11:44:28][Step 1/3] SELECT 'ModuleList' AS RS_Type, ModuleId, ModuleDesc [11:44:28][Step 1/3] FROM MyDB.cfg.App_Module [11:44:28][Step 1/3] WHERE ModuleStatus = 2 AND SecurityAdmin = 2 [11:44:28][Step 1/3] ORDER BY ModuleId
I checked that the same changeset has changes for the table and the stored proc. Here is log lines that confirms that the table was created before stored proc update.
[11:44:19][Step 1/3] VERBOSE: Creating [cfg].[X_App_Module] [11:44:19][Step 1/3] VERBOSE: Creating primary key [PK_X_App_Module] on [cfg].[X_App_Module]
How to see the script that SQL Compare uses to update/validate DB? Where can I find source code of Invoke-DlmDatabaseSchemaValidation? What might be the source of the problem?
Tagged:
Comments
I had to merge schema change manually then I got schema error for DLM Sync. I removed IgnoreChecks from options and it helped for that case but I am not sure if it works for DLM Build.
https://documentation.red-gate.com/display/SC12/Options+used+in+the+command+line#Optionsusedinthecommandline-IgnoreChecks
The best way to get the script would be to use SQL Compare Pro: you can then start a comparison between Source Control and an empty DB (which simulates the behavior of Invoke-DlmDatabaseSchemaValidation) and generate a script.
For more information on this cmdlet please read http://documentation.red-gate.com/display/DLMA2/Invoke-DlmDatabaseSchemaValidation
Thank you,
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools