How can we help you today? How can we help you today?
PeterDaniels
Thank you, @Russell D I'm using SCA. I've read the SCA docs on data. That didn't quite get me there, though. I want to use a where clause filter in the SCA project, like I can do inside SQL data compare. / comments
Thank you, @Russell D I'm using SCA. I've read the SCA docs on data. That didn't quite get me there, though. I want to use a where clause filter in the SCA project, like I can do inside SQL data co...
0 votes
Thank, Mac.  I'm using package deployment.  I'm using New-DatabaseReleaseArtifact + Export-DatabaseReleaseArtifact.  One of the outputs of Export-DatabaseReleaseArtifact is a "TargetedDeploymentScript.sql".  This script works for me, but I have to edit it to remove the code that requires a specific target server name. I'm asking if there is a setting in the project file that I can use to have it not include that check so I don't have to edit it each time? Example of the generated code I remove: -- As this script has been generated for a specific server instance/database combination, stop execution if there is a mismatch IF (@@SERVERNAME != 'ATL2100PC0GQ1DZ' OR '$(DatabaseName)' != 'TestSCA_DEV_INT') BEGIN RAISERROR(N'This script should only be executed on the following server/instance: [ATL2100PC0GQ1DZ] (Database: [TestSCA_DEV_INT]). Halting deployment.', 16, 127, N'UNKNOWN') WITH NOWAIT; RETURN; END GOMy PoSh function to remove it: function Remove-LinesFromFileAfterMatch { [cmdletbinding()] param ( [parameter(Mandatory=$true)] [string] $FilePath ,[parameter(Mandatory=$true)] [string] $StringToMatch ,[parameter(Mandatory=$false)] [int] $NumLinesToRemove = 1 ) begin { $TempFile = New-TemporaryFile $LineNum = 0 } process { switch -Wildcard -File $FilePath { $StringToMatch { # We don't want to output this line or the next $NumLinesToRemove $LineNum++ continue } {$LineNum -gt 0 -and $LineNum -le $NumLinesToRemove} { $LineNum++ continue } # Send rest of teh orig file to the new file default {$_ >> $TempFile} } } end { # and now swap the files (tmp -> orig) Copy-Item -Path $TempFile -Destination $FilePath -Force $FilePath } }And using it with the file: $FilePath = "C:\users\peter\tmp\TargetedDeploymentScript.sql" $Args = @{ FilePath = "$FilePath" StringToMatch = "-- As this script has been generated for a specific server instance/database combination, stop execution if there is a mismatch*" NumLinesToRemove = 8 } Remove-LinesFromFileAfterMatch @Args / comments
Thank, Mac.  I'm using package deployment.  I'm using New-DatabaseReleaseArtifact + Export-DatabaseReleaseArtifact.  One of the outputs of Export-DatabaseReleaseArtifact is a "TargetedDeploymentScr...
0 votes
Follow up: since I included the __migrationLog table and its data as part of the initial, non-SCA generated deployment to our "higher" (ops DBA controlled) environments, I was able to introduce the new idea of using a SSQLCM script to the ops DBAs. The second deployment was the addition of a single new migration in a New-DatabaseReleaseArtifact generated TargetedDeploymentScript.sql. I manually modified it to comment out the target sever check, so they would have one script (currently a requirement) for all of their servers. They successfully ran that in uat and load test servers, so we're at least gaining the benefit of SCA generated deployment scripts and tracking in the __migrationLog table. Concurrently, I've had some meetings to introduce the idea of using PowerShell to deploy using the Use-DatabaseReleaseArtifact cmdlet. That would give us the added benefit of snapshot, drift check, etc. as an intermediate step. I've also showed then a taste of my POC using SCA, bamboo, and Octopus deploy, but my sense is we're months (or longer) away from being able to get buy-in for that move. Thank you for your help, Steve. Honored to have a celebrity work with me in the forums. -Peter / comments
Follow up: since I included the __migrationLog table and its data as part of the initial, non-SCA generated deployment to our "higher" (ops DBA controlled) environments, I was able to introduce the...
0 votes
Thank you, @Mike U! I think this falls under the umbrella of needing to update the docs. I'd be willing to help you and the team with this process. Cheers. -Peter / comments
Thank you, @Mike U! I think this falls under the umbrella of needing to update the docs. I'd be willing to help you and the team with this process. Cheers.-Peter
0 votes