SSDT Schema Compare keeps finding differences for users? - sql

The title says it all but for further details. When i use the schema compare tool in VS2015 for my SSDT Project and my database on a server. The compare results always come back with the Users as being different. I check the differences it speaks about but there is not a single difference between the environments.
I even went as far as updating my project from the compare results to try and correct these "differences". I then ran another compare and the same users came back with differences again... WHAT! haha.
Anyone have a clue what would cause this sync issue or am i doing something wrong? The users were added manually to the database on the server rather then thru SSDT deployment so maybe that is a reason?
EDIT:

Please hit the arrow on the left of the user differences found. You will see a properties folder and the missing login which is the real difference. If you go Schema Compare Options -> Object Types (tab) -> Non-Application-scoped -> Logins to add Login object type to your comparison then your issue will be resolved.
Logins objects

Although I consider this a bit of a workaround (I haven't found a real solution to get rid of the Users from the comparison even when they're indentical), it's the best I've found. Simply exclude Users from the comparison.
You can access this menu by clicking the gear icon on the Schema compare window and expanding the Application-scoped object and unchecking Users (or indeed anything you else you want to exclude).

When I drill into the schema compare under Change > User > Properties > Spanner icon, I can see this difference:
Source (SQL Azure) Target (Project)
============= ===================
UserType=2 UserType=0
What does this mean? I googled to no avail.
Updating doesn't fix it. Deleting the user script from the project and Updating doesn't either.
I can't find UserType in the source code so this must be generated internally by the compare.

In Visual Studio 2017 at least (and it looks like option is in 2015 as well), try going to Schema Compare options and under the "General" tab, untick the option "Ignore login SIDs".
I had this same problem with a user (where there wasn't a login defined for the user), and unticking this option resolved the problem for me. I still picked up actual correct user changes, but for existing users that are unchanged, the comparison no longer shows a bogus item.

Related

Is there a way to extract Access Modules without opening the file?

I ended up corrupting my database to where every time I attempt to open it, I get error 3022, "changes you requested to the table were not successful because they would create duplicate values in the index."
Recovery of the file does not seem possible and my previous back up is a month ago. I have been able to extract everything but the Modules, which is what I need to recover the most. None of the standard ways I have found work because they require the ability to open the database (For example, trying to set it as a VBA reference still give the same error.)
Is there any way to get the modules or code out of the file without opening it?
Edit:
Was finally able to get access to the file. Using DBEngine.CompactDatabase it was able to do a compact and repair. The issue has boiled down to the "MSysAccessStorage" table is corrupt, and says "Id is not an index in this table". I know have access to everything, except the modules, which I can't open without the MSysAccessStorage working.
I'm going to keep poking at it but I'm not sure what options I have for fixing a system table. Any ideas would be helpful.
Unfortunately, the Visual Basic for Applications project has been corrupted. The original database doesn't even have any VBProjects when listing a count. I'm going to call this one a lost cause. Thanks everyone that tried to help.

Section Access In Qlikview

GOAL:
-To allow the manager to only view the all projects in qlikview, and not edit anything.
-Team members can only see data from projects they are in
CONDITIONS:
-Joe(Team member) can only see data from his projects only.
-Bob(Manager) can see data from all projects in the team, however he cannot edit or make changes to them.
In this scenario, there is only 1 manager, an admin, and many team members.
So I guess the process would be:
Check who the user is (Not sure what to use here. Username/password? Ideally it would be the company email, but don't know if this is possible)
Once it knows who the user is, checks if said person can access the document
If they do have access, it decides what can be accessed. (if manager, can only view all projects, if team member, can only view certain projects)
Display the dashboard.
Right now, the QVW file gets data from a database using OLEDB connection.
Sorry I've only been introduced to Qlikview about a week ago and I've been tasked to get this done so any help would be great.
Thanks.
You can find a lot about QV section access around.
Think your scenario is possible to be achieved using section access. Please read https://community.qlik.com/docs/DOC-1853 for more detailed explanation of section access methods.
Warning: Always have copy of the document without section access!
Just to be sure you are not locked out of the document because if this happens there is no way to open the document

Toad: Table Autocomplete Functionality Not Working

I've been using Toad for more than a year now without problems. All of a sudden the table autocomplete feature has ceased working. No settings have been changed, and I've clean installed a new TOAD version, yet the problem persists.
The image below shows autocomplete defaulting into view IN_INSTRUMENT in schema MCDM. Normal behaviour should result in a table/view list.
It is notable that the above does not happen with all schemas. For some schemas I will still see a table list. In the beginning this error happened only with a single schema. Now it is slowly progressing to other schemas as well, which is exceptionally frustrtating when you're dealing with dozens of schemas that contain hundreds of tables each. It slows down development when you must open Schema Browser and look for the exact table/view/procedure/package each time instead of letting autocomplete give suggestions.
This same issue has been described in this thread and and this thread with less detail, yet no accepted answer has been given.
As can be seen from Code Assist settings, these should be in order.
How to reset autocomplete behaviour into what is its original state?
Under View > Toad Options > Editor > Code Assist > Toad Insight Objects, checking Synonyms (in addition to Public Synonyms) worked for me.
I've found the solution to this problem. The issue was a corrupt configuration file. For anyone else with the same problem, this is how I fixed mine:
Backup your appdata folder - you can find its location in options -> general -> application data.
Create a new set of user files using Utilities -> Copy User Settings -> Create clean set of user files. Make sure you are running Toad with administrator rights.
Note that the above will delete all your saved connection details (schema names, passwords, connection strings), so take a note of these.
Hope this helps someone in the future.
Try to check "Public synonyms" in the "Toad insight objects".
Go to Toad Options, and then Editor > Code Assist and uncheck "Cache Code Insight results". This made it immediately start working for me using Toad for Oracle version 9.7. I could then go back and check the box and it would still work.
I faced the same problem even though I set up everything mentioned above.
So basically Toad does not suggest column names if I don't define the scheme name.
X(schema).TABLE_NAME.(then lists all columns)
Worked for me..

Migrations don't run on hosting

I'm using MigratorDotNet to manage Rails-style migrations for my web app. I have a workflow where, if I delete all the tables in the database, I can access an installation view that will run MigratorDotNet and create all the necessary tables.
This works locally. For some reason, when I upload my code to my Arvixe hosting, the migrations just never run. I get this odd error:
There is already an object named 'SchemaInfo' in the database.
This is odd because, prior to running migrations, I manually deleted all the tables in the database (to make sure it wasn't left over from a previous install).
My code essentially boils down to:
new Migrator.Migrator("SqlServer", connectionString.ToString(), migrationsAssembly).MigrateToLastVersion();
I've already verified by logging that the connection string is correct (production/hosting settings), and the assembly is correctly loaded (name and version).
Works locally, but not on Arvixe. How do I troubleshoot this?
This is a dark day.
It turns out (oddly) that the root cause was my hosting company used a schema other than dbo for my database. Because of this, the error message I saw (SchemaInfo already exists) was talking about their table.
My solution, unfortunately, was to rip out MigratorDotNet and go with FluentMigator instead. not only did this solve the problem, but it also gave me a more intelligible error message (one referring to the schema names).
While it doesn't seem possible to auto-set the schema, and while I need to switch the schema on my dev vs. production machine, it's still a solvable problem (and a better API, IMO). I googled, but did not find any way to change the default schema in migratordotnet.
I'm sorry for the issues that you were having. On shared hosting, unfortunately the only way that we may be able to change the schema is manually. If you are still looking for a solution that requires our assistance, please forward your ticket ID to qa .at. arvixe.com as well as arvand .at. arvixe.com and we can look into the best way to resolve this.

Accessing tables from different .mdb files

I need to show a grid of saved projects (compare "orders") in a datagrid, where the projects are saved in an Access 2000 database with a similar schema as follows:
ID Name Country_ID Plant_Type
1 'Test' 1 1
2 'Second' 2 2
Let's call the file "Projects.mdb". This is then showed in the datagrid as:
ID Name Country Plant Type
1 'Test' 'Germany' 'Free Range'
2 'Second' 'France' 'Inclined Roof'
where the countries and "Plant Types" are fetched from a different table in a different .mdb file (also Access 2000, call it "Language.mdb", although there is a lot of different background data in it), depending on the current user's language preference. It is unfortunately not an alternative to merge these .mdb's into one file.
To be able to show the datagrid I have so far linked the tables from "Language.mdb" into "Projects.mdb", but this screws up when the project is being installed on another computer with the .msi file i created (we'd like to have this easily packaged and installed), as the "Language.mdb" doesn't exist on the linked path on the target computer (Basically the problem here).
I can come up with the following solutions:
Force all users to install on the same path, so that the links will work (undesirable)
Use connection strings in the query as shown here on MSDN (still trying this out, but I need to work on the details)
make a post-install script that relinks the tables according to the correct path.
But I think I'm doing something wrong here. As stated above, it is not an option to merge the .mdb-files, but other suggestions to changing the database schema or whatever it could be (I'm not very experienced with databases) would be very appreciated.
To get around the 'different install paths' problem I use code (on every database load) which first looks for any back end databases in the current db folder; if not found, it asks the user to locate the missing .mdb file. Then the code relinks the database(s). Once the dbs have been successfully linked, the database saves the path and checks this path first on subsequent loads.
Well, based on the constraints that you have put on the solution. I would either go with option 2 or 3. There is not an elegant solution to this at all.
I would however, lean towards your third option, as a "one time" fix to get the files linked, so that the path between them is known, and you are not dynamically adding path information into every query.
note
I'll just mention, but I'm sure you already know this, that if you are looking at doing something like this, it just feels wrong to be doing it with Access, let alone access 2000 at this time for client deployments. I would strongly recommend additionally truly evaluating the solution and see if you can either merge to one, or possibly move to SQL Server Express or something that you could send off to the user as an installer
Is Project split, as it should be, to allow a front end on each user's computer? If so, can you not store the path on the front-end and only re-link if it changes? Code to re-link tables is quite simple, for the most part. The user can be allowed to browse for the location and the Connect property can be updated accordingly.