What are the challenges you face when working across database platforms? Take the survey
Options

Second /Option Parameter will be ignored in powershell

schnandrschnandr Posts: 6
edited June 13, 2013 9:35AM in SQL Compare Previous Versions
I am using the following code in powershell to compare a db
function CompareDB($destServer)
{
	$destServerAdj = $destServer -replace "\\","_"
	sqlcompare /Options:Default,ForceColumnOrder /scr1:..\Database /s2:$destServer /u2:user /p2:pwd /db2:DWH /ftr:.\dbcompare.scpf /sf:.\$destServerAdj"-DWH-sync".sql /force
}

My Problem is that the second option Parameter ForceColumnOrder will be ignored. I tested it with multiple parameters and it seems that it is a general problem that the second parameter will be ignored when you call sqlcompare in powershell. Any solution for this?

Comments

  • Options
    Found the solution. Just put the option parameters in quotes
    function CompareDB($destServer) 
    { 
       $destServerAdj = $destServer -replace "\\","_" 
       sqlcompare /Options:"Default,ForceColumnOrder" /scr1:..\Database /s2:$destServer /u2:user /p2:pwd /db2:DWH /ftr:.\dbcompare.scpf /sf:.\$destServerAdj"-DWH-sync".sql /force 
    } 
    
  • Options
    Eddie DEddie D Posts: 1,792 Rose Gold 5
    Hi Schnandr

    Thank you for your post and excellent news you found the solution to your problem. I will add this to our knowledge base and hopefully other users will benefit.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.