How to save SQL Schema Compare options in VS 2012? - visual-studio

VS 2010 had a way to save Schema Compare options so that they will be applied to all schema compares.
VS 2012 seems to only persist the options for a single compare; once I close the window, all my options revert back to defaults.
How do I persist SQL Schema Compare options in VS 2012?
p.s. I ended up saving a Schema Comparison (.scmp) with my settings, and now I just open that file instead of creating a "New Schema Comparison". It's a shame that the feature from VS2010 did not make it to VS2012.

Take a look at this MSDN thread:
http://social.msdn.microsoft.com/Forums/en-US/ssdt/thread/3110809b-fa51-485e-91cb-4f530f84c924
There are no global settings, but you can save a comparison as an
.scmp file, which includes your comparison options. Also, if you
create a Schema Compare file from the SQL menu (so it has no selected
source or target), set the options you want and then save the file,
you can create a template for future comparisons.

Related

Visual Studio 2013 always opens Properties window in Category sorting

I am pretty sure that Microsoft changed something between Visual Studio 2010 - 2012/2013.
Whenever I open the Properties window for the first time in a Visual Studio 2013 instance, it defaults to the Category sorting rather than the Alphabetical sorting.
In 2010, I know that the sorting was stored and remembered in new instance of VS. If I used Alphabetical sorting before, it opened the Properties window in Alphabetical sorting.
In 2013 however, it always defaults to Category. This is really annoying as my eyes are unused to find Properties in the long list of a Windows.Forms control properties for example.
Can anyone reproduce this issue and may even have a fix for this?
Something is broken on your machine if this does not persist between VS sessions. Always hard to guess what that might be, you'll need to look for the reason that the current settings are not getting saved on your machine. There is one specific file that gets updated every time you exit VS, it records the value that you care about.
You'll find it in C:\Users\YourName\Documents\Visual Studio 2013\Settings\CurrentSettings.vssettings. Pay attention to the time stamp of the file to ensure it is getting written. Use SysInternals' Process Monitor if necessary to find out why the write is failing. Or suspect a troublesome add-in that does not let VS shutdown properly.
If absolutely necessary, you can edit the file yourself. Copy it to an .xml file so it is easy to reformat with Edit + Advanced + Format Document. The relevant entry looks like this (edited to fit):
<Category name="Environment_PropertiesWindow"
Category="{731a3cc7-de5e-49ca-9115-9a03e46624b0}"
Package="{7494682b-37a0-11d2-a273-00c04f8ef4ff}"
RegisteredName="Environment_PropertiesWindow"
PackageName="Windows Forms Designer Package">
<PropertyValue name="PbrsAlpha">1</PropertyValue>
<PropertyValue name="PbrsShowDesc">1</PropertyValue>
</Category>
The "PbrsAlpha" property value determines the sorting, it is 1 for alphabetical sort, 0 for category sort.
I did the same thing and saved settings file by changing PbrsAlpha value to "1" but the file will reset itself after restarting Visual Studio.
I found this solution:
Tools -> Import and Export Settings... -> Reset All Settings -> Save my current settings ( in case of a bad scenario) -> Finish

SSDT schema compare - ignore system service brokers (VS 2013)

I have a database project in my solution and a database imported from windows azure via SSMS "Import data-tier app..." option. When using schema compare, the comparison shows system "service brokers" (message types, queues, etc.) in the delete section. When I apply the update, everything works, but these system service brokers are not deleted and appear again and again.
I suppose that it is not possible to delete them, but is there a possiblity to ignore them in the schema compare?
If you click on the settings icon (looks like a cog on the compare tool toolbar) and then navigate to the Object Types tab you should be able to select/deselect the object types you wish to include/ignore in your comparison.
The icons in the Object Types tab match those in the comparison so it should be pretty easy to ignore what you wish to ignore.

TFS 2012: Change work item type

I have TFS 2012 installed. I want to change work item types, e.g. from bug to test case or something else. How can I do it? Maybe configure process template or tfs somehow? I have admin permissions, but don't know what and where to change.
I've already tried to export these items to Excel, but "Work item type" field in exported file is read-only.
You cannot change a work item type; however, you can create a copy of a work item to another type through the web access or Visual Studio. See this blog post for detailed instructions.

Erasing the Find/Replace History on Visual Studio 2010

I've looked around online to try to find a way to delete the history of VS 2010's Find/Replace feature, but all I've gotten are answers only valid for previous versions (VS 05, VS 08, etc.). Does anyone know how clear it for the 2010 version?
Thanks!
Open regedit.exe, go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Find. Remove all keys that starts with Find and Replace, like Find1, Find2, Replace1, etc. You can remove history for Find only or Replace only, or remove only particular Find, if you want to.
HKEY_CURRENT_USER user is for user that is currently logged in.
If you need to clear history for another user, you need to go to HKEY_USERS\{UserId}\Software\Microsoft\VisualStudio\10.0\Find
For example HKEY_USERS\S-1-5-21-2705333110-2095705488-3072420928-1000\Software\Microsoft\VisualStudio\10.0\Find.
[EDIT]
Step-by-step:
Make a quick console application:
using Microsoft.Win32;
public static void Main()
{
var findKey = Registry.CurrentUser.OpenSubKey(#"Software\Microsoft\VisualStudio\10.0\Find", true);
findKey.GetValueNames()
.Where(arg => Regex.IsMatch(arg, #"^Find( \d+)?$"))
.ToList()
.ForEach(findKey.DeleteValue);
}
Compile it and close VS.
Run the compiled exe.
Open VS - Find history is empty.
Keep in mind that VS caches this Find and Replace lists. It persists the lists to the registry when you close VS. So if you clean the list and then restart VS, you will see no effect, because VS restored the list on the shutdown. So you need to close VS, clear the list, open VS.
My 2 cents - if all else fails, just try searching a lot of different terms yourself. There is a limit on how many searches it remembers, and eventually your own searches will push the unwanted ones off the list.
For Visual Studio 2017:
http://www.visualstudioextensibility.com/2017/07/15/about-the-new-privateregistry-bin-file-of-visual-studio-2017/
https://github.com/Microsoft/VSProjectSystem/blob/master/doc/overview/examine_registry.md
Extract:
Close Visual Studio
Start Regedit.exe
Select the HKEY_LOCAL_MACHINE node
From the main menu, select File -> Load Hive... and select the private registry file. That file is stored in the Local App Data %localappdata%\Microsoft\VisualStudio\[config]\privateregistry.bin where [config] corresponds to the configuration hive you would like to browse
It will prompt for a name - that represents the name that will be displayed under (e.g. IsolatedHive)
Now you should be able to browse the registry under the hive you created
Now search for the key "Find" and delete whatever you need to delete.
Before launching Visual Studio, you need to unload it: From the main menu File -> Unload Hive before attempting to run VS (otherwise regedit keeps the file locked, and Visual Studio will fail to launch)

How can I see other schemas apart from my own when connecting to an Oracle database through server explorer?

I am attempting to add a connection to an Oracle database through Server Explorer. The 'Test' Connection' is successful, however whenever I go to view the list of tables / schemas, I can only see the one associated with my login.
I realise this sounds silly, but when I use the same login/password through Toad for Oracle, I am still allowed to browse "All Schemas" to find the tables I want.
Is this possible through Server Explorer? Or do I need to find a specific login for the schema I want to access?
Solution (just so it's here and not just on the OTN forums)
Right-click on connection in Server Explorer
Choose filters
Select the "Dispalyed Schemas" row in the property grid (it should be selected by default)
In the Property/Condition/Value fields, click the "..." button for Value
Pick any schemas you want to see and click Ok.
Conversely, instead of using the dialog that appears after clicking the "..." button, you can list the schemas separated by commas in the Value textbox.
Oracle's way of dealing with users and schemas is different from SQL Server's. So I suspect the default Visual Studio behaviour won't work properly with Oracle.
Have you installed the free Oracle Developer Tools for Visual Studio? Find them here. If you do that then you can manually add the other schemas to the filter of your main connection. I found instructions in this OTN forum thread:
"highlight the connection node you
want to moidy and choose filters or
right click on the specific connection
node and choose modify then click on
the filters tab to modify the
filters."
I agree this is clunky, and it should be done automatically. I guess there's a limit to how VS can be extended.

Resources