Filtering Users?
EHSUser
Posts: 9
Greetings,
I have been using SQL Compare for quite some time though we have just recently decided to automate the process.
We usually use the default settings with the exception of Ignoring users.
However, when I use the option Options.IgnoreUsers nothing seems to happen. The users are still included in the schema script.
The compare status still says "Reading users".
I am using the line
What am I doing wrong?
Thanks,
Kevin
I have been using SQL Compare for quite some time though we have just recently decided to automate the process.
We usually use the default settings with the exception of Ignoring users.
However, when I use the option Options.IgnoreUsers nothing seems to happen. The users are still included in the schema script.
The compare status still says "Reading users".
I am using the line
Dim myOptions As Options = Options.IgnoreUsers Or Options.Default Or Options.IgnorePermissionsYet my output says
Reading usersand
CREATE USER [EHSMGR] FOR LOGIN [EHSMGR] WITH DEFAULT_SCHEMA=[dbo] GRANT CONNECT TO [EHSMGR] GOin the script.
What am I doing wrong?
Thanks,
Kevin
Comments
are you always using this var?
there are a few places for it to be passed into. Depending on your code
eg
db1.Register(new ConnectionProperties("(local)", "WidgetDev"), myOptions);
Differences differences=db1.CompareWith(db2, myOptions);
work.BuildFromDifferences(differences, myOptions, true);
Regions regions=work.ScriptObject(db.Tables[0], myOptions);
Hope that helps.
David
For instance,
I use to build by script.
But the script still has the users in it.
Ignore Permissions seems to leave out the permissions, as it should.
Ignore User Properties leaves out the Properties, as it should.
But when I use IgnoreUsers I still get this line in my script:
so either I am misunderstanding what that options is supposed to do, or something is not working properly.
Yes you are right IgnoreUsers means "Ignore users' permissions and role memberships."
I think you want the following code Hope that helps.
Regards
David
Thank you
I should have written Please excuse my mistake...
Regards
David