How can we help you today? How can we help you today?
bhopenw
I am having a very simular issue where a stored proc is being updated before the column is added. Is there a way to force order? I am using SQL COmpare 8.1 for the Cmd line via an automated powershell script. thanks, BJHop / comments
I am having a very simular issue where a stored proc is being updated before the column is added. Is there a way to force order? I am using SQL COmpare 8.1 for the Cmd line via an automated powers...
0 votes
As I said here is the powershell code I created to get the job done It will update sql changeset with a new workspace to poll I believe it will help us enfore local standards to help work with a local scp file This script got a bit more complex than I first thought but I think it works well enjoy Please let me know if you have any comments or questions #Set-SQLChangeset #this script set up SQL Changeset for use with a SCP and local workspace param([string] $serverPath = $(throw 'The TFVC server path to DB schema is required'), [string] $localPath = $(throw 'The local path to workspace is required'), [string] $tfsUrl = $('http://as73tfs01:8080')) ###MAIN### $ErrorActionPreference = "Stop" write-debug "Starting" #using [void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client") [void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.VersionControl.Client") #set variables $tfs = New-Object Microsoft.TeamFoundation.Client.TeamFoundationServer($tfsUrl) $vcs = $tfs.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer]) $wsCurrent = [Microsoft.TeamFoundation.VersionControl.Client.Workstation]::Current #may push to this to config file [string] $wsName = "SQLChangeset_" + $(Split-Path $localPath -leaf) [string] $path2ConfigXml = "C:\Documents and Settings\$($env:USERNAME)\Local Settings\Application Data\Red Gate\SQL Changeset\Configuration.xml" [string] $path2sqlCs = "C:\Program Files\Red Gate\SQL Compare 8\SQL Changeset\RedGate.SqlChangeset.exe" [string] $user = $Env:USERDOMAIN + "\" + $Env:USERNAME if (-not (Test-Path $path2ConfigXml)) { #SQL Changeset has not been started for first time Write-warning "Starting SQL Changeset for first time" Write-Warning "Please close once started" & $path2sqlCs } #we need to be sure that SQL CS is not running #if it is we need to find out what to do while ($(Get-Process | ?{$_.Name -eq 'RedGate.SqlChangeset'})) { Write-Host "SQL Changeset cannot be running while this process is completed" Write-Host "To exit right-click on the SQL ChangeSet icon in the notification" Write-Host "area in the right hand side of the status bar where the clock usually is" switch -regex (Read-Host -Prompt "[R] Retry, [K] Kill the process, [A] Abort") { "R|r"{} "A|a" { write-host -ForegroundColor Red "Abort: Cannot continue with Red Gate SQL Changeset running" return } "K|k" { Write-Warning "Killing the process may have unkown effects on SQLChangeset" switch -regex (Read-Host -Prompt "Are you sure you want to kill the SQL Changeset process [Y/N]") { "Y|y" { $sqlcs = $(Get-Process | ?{$_.Name -eq 'RedGate.SqlChangeset'}) $sqlcs.Kill() sleep -Seconds 5 } "N|n" {} } } } } if (-not (Test-Path $localPath)) { New-Item -Path $(Split-Path $localPath -Parent) -Name $(Split-Path $localPath -leaf) -ItemType Directory | Out-Null } else { if ($wsCurrent.IsMapped($localPath)) { Write-Host -ForegroundColor Red "Error: Local path already mapped; $localPath is already mapped on this workstation" return } } #check to ensure a workspace with same name not already created if($wsCurrent.GetAllLocalWorkspaceInfo() | ?{$_.Name -match $wsName}) { Write-Host -ForegroundColor Red "Error: workspace name - $wsName - already in use" Write-Host "Workspace name is taken for the local path directory name" return } ##assume directy name is a good name ie DB name $ws = $vcs.createworkspace($wsName) $ws.map($serverPath, $localPath) Write-Debug "Workspace created" [System.IO.FileInfo] $configXml = Get-Item $path2ConfigXml Copy-Item -Path $configXml.FullName -Destination $($configXml.FullName + ".bak") -Force [string] $configXmlContents = gc $configXml #check to make sure the server path has not already been used Write-Debug "configuration xml backed up" #search if ($configXmlContents -match "\$serverPath") { Write-Host -ForegroundColor Red "Error: $serverPath already in use in SQL Changeset" Write-Host "Workspace will be deleted" $ws.delete() return } [xml] $xml = [xml] (gc $configXml) $projects = $xml.ConfigurationFile.SelectSingleNode("Projects") #need to crate xml elements [System.Xml.XmlElement] $pair = $xml.CreateElement("PairOfScProviderOpenProjectInfo") [System.Xml.XmlElement] $scp = $xml.CreateElement("ScProvider") [System.Xml.XmlElement] $scpC = $xml.CreateElement("ScProvider") [System.Xml.XmlElement] $opi = $xml.CreateElement("OpenProjectInfo") [System.Xml.XmlElement] $opiC = $xml.CreateElement("OpenProjectInfo") $scpC.SetAttribute("Name", "Team Foundation Server MSSCCI Provider") $scpC.SetAttribute("Registry", "SOFTWARE\Microsoft\Team Foundation Server MSSCCI Provider") $scpC.SetAttribute("Dll", "C:\Program Files\Microsoft Team Foundation Server MSSCCI Provider\TfsMsscciProvider.dll") $scp.AppendChild($scpC) Write-Debug "Updating configuration xml" #This is the path SQL CS uses #I think the info it needs to get the workspace object [string] $wsPath = "$tfsUrl/|$wsName|$user" $opiC.SetAttribute("LocalPath", $localPath) $opiC.SetAttribute("Name", $serverPath) $opiC.SetAttribute("Path", $wsPath) $opiC.SetAttribute("User", $user) $opi.AppendChild($opiC) $pair.AppendChild($scp) $pair.AppendChild($opi) $projects.AppendChild($pair) $xml.Save($configXml.FullName) Write-Host "SQL Changeset has been successfully updated" Write-Host "Starting SQL Changeset" & $path2sqlCs / comments
As I said here is the powershell code I created to get the job done It will update sql changeset with a new workspace to poll I believe it will help us enfore local standards to help work with a lo...
0 votes
While I have got the table drop capture working I am searching for a way to see a column drop. I believe that only way to get this done is to use the SDK. I that is the way I'm going to move now, unless, anyone has a way w/o the SDK. Thanks, BJHop / comments
While I have got the table drop capture working I am searching for a way to see a column drop. I believe that only way to get this done is to use the SDK. I that is the way I'm going to move now, ...
0 votes
Okay I forgot to have my V8 this morning just realized that real issue was not the fore mentioned SP but the one just below it dbo.SDISP_HLIC_GET_InquiryMaster.sql and the error message what telling me it all along I thought I had case sensitive option set Nevertheless, I am facing a new issue one that I have had before and just mentioned. SQL Compare keep considering one SP as different even I've synced multiple times. Issues is large block of Commented out code, as soon I ignore comments all is fine but I'd like to have comments synced Below is the code: SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO -- ============================================= -- Author: L&T Infotech -- Create date: 12th-Nov-2008 -- Description: To assign the products with the Waiver premium to a respective employee -- ============================================= CREATE PROCEDURE [dbo].[SDIsp_HLIC_Enroll_InsertUpdate_EmpWaiverOfPremium] ( @p_employee_id bigint, @p_user_ad_id varchar(30), @p_user_role varchar(30), @p_prod_waiverofpremium_xml xml ) AS BEGIN SET NOCOUNT ON -- ============================================= BEGIN TRY CREATE TABLE #temp_PROD_DETAILS ( ROWID INT IDENTITY(1,1), PLAN_TYPE VARCHAR(30), PRODUCT_NAME VARCHAR(30), EMP_PROD_RL_ID BIGINT, WAIVER_OF_PREM_EFFECTIVE_DATE DATETIME, WAIVER_OF_PREM_END_DATE DATETIME ) DECLARE @v_xmlhandle int EXEC SP_XML_PREPAREDOCUMENT @v_xmlhandle output, @p_prod_waiverofpremium_xml INSERT INTO #temp_PROD_DETAILS (PLAN_TYPE, PRODUCT_NAME, EMP_PROD_RL_ID, WAIVER_OF_PREM_EFFECTIVE_DATE, WAIVER_OF_PREM_END_DATE ) (SELECT * FROM OPENXML (@v_xmlhandle, '/root/prod_waiverofpremium', 2) WITH (plan_type varchar(30), product_name varchar(30), emp_prod_rl_id bigint, waiverofpremium_effective_date datetime, waiverofpremium_end_date datetime ) ) select * from #temp_PROD_DETAILS DECLARE @v_nextrowid INT SET @v_nextrowid = (SELECT COUNT(*) FROM #temp_PROD_DETAILS) WHILE @v_nextrowid > 0 BEGIN UPDATE PCPRCE SET PCPRCE.WAIVER_OF_PREM_EFFECTIVE_DATE = temp.WAIVER_OF_PREM_EFFECTIVE_DATE, PCPRCE.WAIVER_OF_PREM_END_DATE = temp.WAIVER_OF_PREM_END_DATE, PCPRCE.MODIFIED_BY = @p_user_ad_id, PCPRCE.MODIFIED_TM = GETDATE() FROM PLAN_CLS_PROD_RL_CLS_EMPLOYEE as PCPRCE INNER JOIN #temp_PROD_DETAILS as temp on PCPRCE.PLAN_CLS_PROD_RL_CLS_EMP_ID = temp.EMP_PROD_RL_ID WHERE temp.rowid = @v_nextrowid AND PCPRCE.ACTIVE_IND = 'Y' AND PCPRCE.VERSION_NO = 0 SET @v_nextrowid = @v_nextrowid - 1 CONTINUE END -- WHILE LOOP END END TRY -- ============================================= BEGIN CATCH EXEC dbo.SDIsp_HLIC_Exception_Log 'Error while assigning the Waiver Products to the Employee' END CATCH SET NOCOUNT OFF END -- ================= /* EXEC SDIsp_HLIC_Enroll_InsertUpdate_EmpWaiverOfPremium @p_employee_id = 860, @p_user_ad_id = 'EMPLOYER13', @p_user_role = 'EMPLOYER', @p_prod_waiverofpremium_xml = '<root> <product_details> <emp_prod_rl_id>535</emp_prod_rl_id> <plan_type>TRUE GROUP</plan_type> <product_name>BASELIFE</product_name> <waiverofpremium_effective_date>2008/12/02</waiverofpremium_effective_date> <waiverofpremium_end_date>2009/05/30</waiverofpremium_end_date> </product_details> </root>' select * from PLAN_CLS_PROD_RL_CLS_EMPLOYEE where PLAN_CLS_PROD_RL_CLS_EMP_ID = 535 */ /* SELECT PC.CLASS_ID, CER.CLS_EMP_ID, PCP.CLASS_PRODUCT_ID, -- PCPRCE.PLAN_CLS_PROD_RL_CLS_EMP_ID, PCPD.PROD_LIFE_INS_DETAIL_ID, PM.PRODUCT_NAME INTO #temp_1 FROM EMPLOYEE E INNER JOIN CLASS_EMPLOYEE_RL AS CER ON E.EMPLOYEE_ID = CER.EMPLOYEE_ID INNER JOIN PLAN_CLASS AS PC ON CER.CLASS_ID = PC.CLASS_ID INNER JOIN PLANS AS P ON PC.PLAN_ID = P.PLAN_ID INNER JOIN PLAN_TYPE_MASTER AS PTM ON P.PLAN_TYPE_ID = PTM.PLAN_TYPE_ID INNER JOIN PLAN_CLASS_PRODUCTS AS PCP ON PC.CLASS_ID = PCP.CLASS_ID INNER JOIN PLAN_CLASS_PRODUCT_DETAIL AS PCPD ON PCP.CLASS_PRODUCT_ID = PCPD.CLASS_PRODUCT_ID INNER JOIN PRODUCT_MASTER AS PM ON PCPD.PRODUCT_ID = PM.PRODUCT_ID INNER JOIN #temp_PROD_DETAILS AS temp ON PTM.PLAN_NAME = temp.PLAN_TYPE AND PM.PRODUCT_NAME = temp.PRODUCT_NAME -- INNER JOIN PLAN_CLS_PROD_RL_CLS_EMPLOYEE AS PCPRCE ON CER.CLS_EMP_ID = PCPRCE.CLS_EMP_ID AND PCP.CLASS_PRODUCT_ID = PCPRCE.CLASS_PRODUCT_ID WHERE temp.ROWID = @v_nextrowid AND E.EMPLOYEE_ID = @p_employee_id AND P.CLIENT_ID = @v_client_id AND E.ACTIVE_IND = 'Y' AND E.VERSION_NO = 0 -- AND CER.ACTIVE_IND = 'Y' AND CER.VERSION_NO = 0 AND P.ACTIVE_IND = 'Y' AND P.VERSION_NO = 0 AND PC.ACTIVE_IND = 'Y' AND PC.VERSION_NO = 0 AND PCP.ACTIVE_IND = 'Y' AND PCP.VERSION_NO = 0 AND PCPD.ACTIVE_IND = 'Y' AND PCPD.VERSION_NO = 0 -- AND PCPRCE.ACTIVE_IND = 'Y' AND PCPRCE.VERSION_NO = 0 select * from #temp_1 SELECT PLAN_CLS_PROD_RL_CLS_EMP_ID FROM PLAN_CLS_PROD_RL_CLS_EMPLOYEE AS PCPRCE INNER JOIN #temp_1 AS T ON PCPRCE.CLS_EMP_ID = T.CLS_EMP_ID AND PCPRCE.CLASS_PRODUCT_ID = T.CLASS_PRODUCT_ID --WHERE -- PCPRCE.ACTIVE_IND = 'Y' AND PCPRCE.VERSION_NO = 0 */ GO GRANT EXECUTE ON [dbo].[SDIsp_HLIC_Enroll_InsertUpdate_EmpWaiverOfPremium] TO [HLIC_READ] GO / comments
Okay I forgot to have my V8 this morning just realized that real issue was not the fore mentioned SP but the one just below it dbo.SDISP_HLIC_GET_InquiryMaster.sql and the error message what tellin...
0 votes