Red Gate forums :: View topic - Second /Option Parameter will be ignored in powershell
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Second /Option Parameter will be ignored in powershell

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
schnandr



Joined: 11 Jun 2013
Posts: 2

PostPosted: Tue Jun 11, 2013 11:59 am    Post subject: Second /Option Parameter will be ignored in powershell Reply with quote

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

Code:
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?
Back to top
View user's profile Send private message
schnandr



Joined: 11 Jun 2013
Posts: 2

PostPosted: Tue Jun 11, 2013 12:46 pm    Post subject: Reply with quote

Found the solution. Just put the option parameters in quotes
Code:

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
}
Back to top
View user's profile Send private message
eddie davis



Joined: 14 Jun 2006
Posts: 922
Location: Red Gate Software

PostPosted: Thu Jun 13, 2013 2:35 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group