Second /Option Parameter will be ignored in powershell

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Second /Option Parameter will be ignored in powershell

Postby schnandr » Tue Jun 11, 2013 11:59 am

I am using the following code in powershell to compare a db

Code: Select all
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
 
Posts: 2
Joined: Tue Jun 11, 2013 10:36 am

Postby schnandr » Tue Jun 11, 2013 12:46 pm

Found the solution. Just put the option parameters in quotes
Code: Select all
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
 
Posts: 2
Joined: Tue Jun 11, 2013 10:36 am

Postby eddie davis » Thu Jun 13, 2013 2:35 pm

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
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests