Automatic check out on Team Foundation Server using SQL Server Managment Studio - sql-server

I have created a project in SSMS and link it to TFS.
When I first created the project a query would check out to me when edited.
However after a re-boot of the PC it is no longer doing this and I have to manually check out to then check back in changes.
Checked in item behaviour are both set at "Check out Automatically"
Any ideas where to start?

Try: Tools > Options > Source Control > Environment
Half way down the screen you have 2 drop-down boxes for Saving and Editing. Set Editingto Check out automatically and you're done.

Related

SQL Server Management Studio does not use color in text editor

I currently have an issue with my SSMS since my PC has been reformatted with windows 10. It doesnt show any functions name with the correct color (should be pink), string (should be red), JOIN (should be grey), etc.
The only keyword it recognize are SELECT, INSERT, PRINT, TRANSACTION and couple more. I checked into my font & colors settings and they are set correctly. I even reinstalled twice without any difference.
EDIT:
Here is an image of how it look like, its a link because i am not allowed to embbed an image directly
EDIT2:
Here is my settings on SQL System Function
I finally found the solution. My Tools -> Options -> International Settings -> Language was set to "Same as Microsoft Windows" which is French. But the rest of my interface is in English. I guess there is a bug where the Setting are in French, but the Editor in English and cant find the color coding properly.
Hope it can help anyone with this problem!
if you would like set all the color back, 1.Tools -> 2.Option -> 3.Environment -> 4.Choose Text Editor in Show setting for, choose Use Defaults if this does not work, than the same steps above, but choose 'Keyword' in Display items in step 4, choose any color you prefer.
UPDATE
Update, GETDATE() and etc are not in keyword catalog, they are in SQL System Function,check that again
2nd UPDATE
In the SSMS, View - Registered Servers to check whether your local Server get registered in Database engine, if you do not see you local computer name shown in Local Server Groups, right click that, hit Task, then Register Local Server
3rd UPDATE
I think you need to restart SQL server database engine instead of restating SSMS only, you could restart it by right click the database engine name, hit restart, if that does not work, try to reboot your local machine

How do I stop Database deploy from removing Server Triggers?

I am deploying my database using a Visual-Studio database project and the Publish wizzard.
The initial deploy works fine and my database is the same as my project. I then apply a third party tool to my database which adds triggers to all my tables.
I then deploy an update to my database and it removes the third party triggers from my database.
how do I stop my deploy from removing triggers that are on the server but not in the project?
I have tried unticking "Drop DML triggers not in source" in the Advance Deployment Settings but this has not worked.
Anyone else have any ideas?
PS:
I am using Visual studio 2015
The rest of my deployment settings are as follows:
So I found the problem.
When I was setting my Advanced Deployment Properties I was doing it by:
Right Clicking Database - Properties
Going to debug tab (there is no Deploy tab in 2015 like the documentation mentions)
Changing my Deployment Options here using "Advanced" button at the bottom.
I then realised that when I clicked Publish on my project there was an Advanced button on here.
Clicking the Advanced button on the Publish dialog showed different options to what I was getting on the projects properties.
I removed the Drop DML Triggers check from this screen and it worked
In addition to this. I then clicked Save Profile and added it to my project using Add Existing Item I then used this answer to set this profile as my default publishing profile

How to debug stored procedure in VS 2015?

I know this was asked many times, I've read them.
I've checked the [Enable SQL Server debugging] in all my projects in the solution.
My projects:
ASP.NET web app
DAL class library. (The DAL uses a legacy .dbml to generate SP calling wrapper code.) No OR mapper neither direct ADO.NET used in the project.
SQL Server 11.0.3153
I would like to debug my called SPs when debugging the C# code in VS. Ideally it should step in to the SP, but if this is not supported, then break in the SP on a set breakpoint.
Unfortunatelly it does neither. If I set a breakpoint in the SP, it is not a filled red circle, instead an unfilled, which is not a good sign. (I am setting this breakpoint in Server Explorer, by opening a data connection, and opening the SP in the VS editor.
What am I missing?
General instructions, based on my experience and research.
Run Visual Studio (community version, in my case) as Administrator (for me, debugging a stored proc from VS only works when VS is run as an admin)
Go to the Solution Explorer, right click on your project and go to properties.
Click on the Web tab and make sure that SQL Server is checked. Save and close.
Click on the View menu, then on SQL Server Object Explorer.
In the SQL Server Object Explorer, expand SQL Server and if you don't see your SQL Server, right click on SQL Server and add it.
Right click on the SQL Server that you just added and make sure that both Application Debugging and Allow SQL/CLR Debugging are checked.
Expand your SQL Server instance that you added and find the stored procedure of interest.
Right click that SP and click View Code.
Put a break point where you wish.
Run and enjoy.
You may have to do some of these things next time you wish to debug a stored proc from VS after you close VS and open it up later.
I had the same problem...
In the "Solution Configurations" dropdown, the selected configuration was "Debug (Active)". I changed that to "Debug."
After the change was made, the debugger worked normally and the "Debug (Active)" option disappeared from the list.

Any way to change look-n-feel for query windows? Just jacked up production

After avoid disasters for a few years, my luck finally ran out.
I had a few query windows open (one of them on our production server which I forgot about). Thinking I was on our dev server, I did all sorts of nasties and totally hosed our production database.
Any BKM's on how you folks keep this from happening?
All advice appreciated!
Open up SQL Server Management Studio
On the View menu make sure that Registered Servers is visible (alternatively hit CTRL+ALT+G
In the Registered Server panel expand Database Engine
Right-click Local Server Groups
Chose New Server Registration
Fill in your necessary server details and then switch to the Connection Properties tab
Click on the Use custom color checkbox
Select the colour to be used. I tend to chose bright-red for live servers and green for development environments.
Save your Registered Server.
Next time you open a query on this connection the status bar at the footer should show the colour you selected.
IMPORTANT: If you change the connection of a query window (option in the right-click context menu) the colour of the status bar does not change. Just be careful out there!
Specially for such case I have added "Important DB Alert" function into my SSMS add-in called SSMSBoost.
You can "save" your production and development databases and assign them different colors. Whenever you change your connection to "Important DB" you will be warned with additional tooltip, appearing in SQL Editor window.
The feature is described here:
http://www.ssmsboost.com/Features/ssms-add-in-preferred-connections

How to remove cached server names from the Connect to Server dialog?

Or, to put it another way, where is SqlStudio.bin for SQL Server 2012? It doesn't seem to be in the place that would be expected by looking at this other SO question.
As of SQL Server 2012 you no longer have to go through the hassle of deleting the bin file (which causes other side effects). You should be able to press the Delete key within the MRU list of the Server Name dropdown in the Connect to Server dialog. This is documented in this Connect item and this blog post.
To be clear, since a couple of people seemed to have trouble with this for months: You need to click on the Server name: dropdown, and down-arrow or hover with your mouse until the server you want to remove is selected, and then press Delete. In this screen shot, I'm going to press Delete now, and it will remove the server ADMIN:SHELDON\SQL2014 from my MRU list. Note that because I merely hovered with my mouse, this is not even the server that is showing in the Server name: text box.
Note that if you have multiple entries for a single server name (e.g. one with Windows and one with SQL Auth), you won't be able to tell which one you're deleting.
Found it!
C:\Users\%username%\AppData\Roaming\Microsoft\SQL Server Management Studio\11.0\SqlStudio.bin
So the answer is as before: delete the file, or use some nifty PowerShell magic to edit it.
As for SQL Server Management Studio v18 it appears this file is now XML and you can edit it directly:
%APPDATA%\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml
If you want to remove particular account or update password on Windows 10 then you can go to Windows Credentials in Credential Manager and update or remove related entry:
Control Panel >> Credential Manager >> Windows Credentials >> Microsoft:SSMS
This is the best way to clear these server names from the list.
Open the(SSMS) version. Mine is 18.
You should be right where you can see the server name dropdown list.
If not, you will open the Connect to Server dialog located in the File menu bar
Click on the Server Name field dropdown list.
"Hover over" (very important) the items you want to remove.
Pressing the delete (DEL) key on your keyboard should do the trick.
You're welcome

Resources