How can we help you today? How can we help you today?

Second /Option Parameter will be ignored in powershell

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?
schnandr
0

Comments

2 comments

  • schnandr
    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 
    } 
    
    schnandr
    0
  • Eddie D
    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 D
    0

Add comment

Please sign in to leave a comment.