Comments
Sort by recent activity
Hi Sebastian,
DLM Automation uses the SQL Compare engine, which will calculate a deployment order based on the dependencies of the objects you are trying to deploy. If a stored procedure references a view then the view should be deployed first, followed by the stored procedure.
It's possible that it could be a bug. If you're not already on the latest version of DLM Automation (2.0.7.256), I'd recommend updating just in case the SQL Compare engine contains changes that fix the problem. Here's a download link - download
If that doesn't fix the problem, would you be open to providing the view and stored procedure definitions so that I can investigate? / comments
Hi Sebastian,
DLM Automation uses the SQL Compare engine, which will calculate a deployment order based on the dependencies of the objects you are trying to deploy. If a stored procedure references...
Can you try the latest release of SQL Source Control? I think this should fix the problem.
Here's a download link - download / comments
Can you try the latest release of SQL Source Control? I think this should fix the problem.
Here's a download link - download
I can replicate this problem when I use your script. Unfortunately it all seems parser related so I think you may need to wait for the next update of SQL Source Control with the latest SQL Compare engine. I'll let you know when the update gets released.
In the mean time, you may want to filter out this view so that you can keep using SQL Source Control without the error occurring.
Apologies. / comments
I can replicate this problem when I use your script. Unfortunately it all seems parser related so I think you may need to wait for the next update of SQL Source Control with the latest SQL Compare ...
I'm sorry that you're experiencing this problem. I've replicated the problem and it seems to be down to a bug in the SQL Compare engine's parser, which has since been fixed. As soon as SQL Source Control is released with the latest version of the engine, this problem should be resolved.
In the mean time, you can work around this by telling SQL Source Control to not throw exceptions on parser errors for this database. If you go to the Setup tab in SQL Source Control and go down to the section labelled Options just for this database, you'll see a link named Comparison options. Click on this. In the comparison options window, find the option in the Behavior section named Throw exceptions on SQL parser errors and make sure this is unchecked. Then click the blue Save button to save the options.
You'll probably want to turn this back on when the fix is released. / comments
I'm sorry that you're experiencing this problem. I've replicated the problem and it seems to be down to a bug in the SQL Compare engine's parser, which has since been fixed. As soon as SQL Source C...
Hi,
We don't support it as this functionality is an old beta, although having said that, it should still work to an extent. This works mostly because a Redgate script folder and SSDT project have a similar structure. You can use it, but it would be at your own risk and we wouldn't be able to help if you encountered problems.
If you'd like to see SSDT projects become fully supported then I recommend that you vote for this UserVoice suggestion and add any comments you might wish to make - https://redgate.uservoice.com/forums/39 ... se-project / comments
Hi,
We don't support it as this functionality is an old beta, although having said that, it should still work to an extent. This works mostly because a Redgate script folder and SSDT project have a...
Hi Phil,
The DLM Automation build process verifies the database by creating the objects that your scripts represent within the temporary database, which in your case is on LocalDb. The errors are coming from the LocalDb instance itself because when DLM Automation tries to create the objects, the external references can't be found.
There's no way of telling it to ignore external references so you have a few options - one option is to make sure the temporary database is able to access the referenced database, so you might want to think about using the same SQL Server instance as the referenced database to build the temporary database. Alternatively, copy the referenced database to the LocalDb instance.
There is a blog post on this subject from some members of the team responsible for creating DLM Automation. I suggest that you take a look at it as they've spent some time approaching this subject in depth - https://www.red-gate.com/blog/database- ... pendencies
I hope this helps. / comments
Hi Phil,
The DLM Automation build process verifies the database by creating the objects that your scripts represent within the temporary database, which in your case is on LocalDb. The errors are c...
Thanks for the feedback.
If you're using a continuous integration server like TeamCity for instance, then you could add a step to the build process that runs a "DELETE FROM RedGateLocal.DeploymentMetadata WHERE..." query on the database, perhaps using sqlcmd.exe. Then when you deploy the build the migration script will run again. Is that feasible? / comments
Thanks for the feedback.
If you're using a continuous integration server like TeamCity for instance, then you could add a step to the build process that runs a "DELETE FROM RedGateLocal.DeploymentM...
As you correctly point out, migration scripts are designed to be run only once because we can't know if it is safe to run a script multiple times. This means that we have two options, and you have mentioned both of them in your post. You can either add a second script to update the data or you can remove the entry from the RedGateLocal.DeploymentMetadata table on the server in order to trick it into executing the script for a second time. There isn't currently any other way to do it. Sorry.
I notice that there is a suggestion for this exact thing on our UserVoice site - https://redgate.uservoice.com/forums/39 ... on-scripts - if this wasn't posted by you then I recommend that you vote for this suggestion and add any comments you may have. / comments
As you correctly point out, migration scripts are designed to be run only once because we can't know if it is safe to run a script multiple times. This means that we have two options, and you have ...
Hi,
This is a difficult scenario. The way I've done this is to use a Python script on the ClientID column for the services table to select the value straight from the Enrollment table. This way the relationship between the ClientID and EnrollmentID values can be preserved. def main(config):
import System.Data.SqlClient
connection = System.Data.SqlClient.SqlConnection(config["connection_string"])
command = System.Data.SqlClient.SqlCommand("SELECT ClientID FROM Enrollment WHERE EnrollmentID = " + EnrollmentID, connection)
connection.Open()
value = command.ExecuteScalar()
connection.Close()
return value
The way that your tables are set up seems to imply that there is some duplication by having the same values for EnrollmentID and ClientID in both the Enrollment and Services tables. Have you considered removing the ClientID column from the Services table and joining the Enrollment table on the EnrollmentID column whenever you query the Services table? Or alternatively, creating a view? / comments
Hi,
This is a difficult scenario. The way I've done this is to use a Python script on the ClientID column for the services table to select the value straight from the Enrollment table. This way the...
Hi Dieter,
This doesn't really look like a SQL Comparison SDK question. It seems to me like your script is already stored in the desired format within the string. I'm not really sure what you want to do - is it that you want to execute the script? If so then you'll probably want to use the SqlCommand class within the .NET framework. See the MSDN documentation for more info - https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1 / comments
Hi Dieter,
This doesn't really look like a SQL Comparison SDK question. It seems to me like your script is already stored in the desired format within the string. I'm not really sure what you want ...