SQL Server Management Studio does not use color in text editor - sql-server

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

Related

MS SQL Server Management Studio - How to create new schema

I want to create a new schema in SSMS with the Schema - New dialog box but I can't find how.
I know it's supposed to open when I right click on the Databases/xyz/Security/Schemas folder in the Object Explorer and select New Schema... but all I get is a query to create it.
I just started an edX course called Developing SQL Databases, there are no instructions there concerning the SSMS settings, the only instructions say that I should be able to get the Schema - New dialog box. I asked there in the discussion but nobody replies, actually there's no activity there whatsoever so probably nobody even knows I asked.
I did google it but the only relevant results I found say the same thing, right-click, New Schema... and the dialog box opens. But it doesn't.
So, what am I missing?
Expand the database in the Object Explorer, and right-click the Security folder, then select "New" (the Security folder under the database, NOT the Security folder under the server).
I realize your question is how to do this in SSMS, but the tsql code for this is only five words.
create schema MyNewSchema authorization dbo;
That seems much simpler to me.
Be sure you are searching in a right folder.
the security folder is under the database , not under the server.
as next screenshot:-
UPDATE:-
This issue is repeated here, and the soluation was the following:-
Full uninstall Manual
deletion of all MSSQL-folders in
AppData{Local|Roaming}
Reinstall
Checking for any updates
and everything is as expected, so try these steps.

Missing Schemas in Crystal Reports

A little bit of an odd issue here.
I have a database, hosted on SQL Server 2008 R2 (SP2), that has 10 different schemas that could be used for reporting purposes:
Please note, for company compliance reasons, I did redact this image to the bare essentials.
Now, when I go to create a report, and connect to the database in question, the only schemas that are presented to me are those starting with lm_:
Again, redacted...
Now, for the purpose of the report I need to build, I need to be able to select against tables that are in one of the ls_ schemas.
My question is, in Crystal Reports 2013, how do I make all available schemas visible for use in a report?
Other important things to note:
I am able to log into SSMS as the same account I am using to connect to the database in Crystal Reports, and am able to successfully run queries against the schemas in question.
The account I am connecting to the database as, in both SSMS and CR, has full administrative access/capabilities against all schemas in the database in question
Points 1 and 2 would suggest that this is not a security related issue
I am connecting to the database in CR through an ODBC connection created on my system through ODBC Data Source Administration (32-bit) - as a System DSN
The ODBC Data Source uses the same administrative account being used directly in CR and SSMS
Thank you in advance for your help. Please let me know if there is any additional information that I can provide to help solve this issue.
I faced similar issue few years back, and as per my experience it has nothing to do with database and it is within the crystal reports where a registry value is set to minimum value which will restrict the display of schemas or tables
Check below link which will show you the path to change registry.
forumtopics.com/busobj/viewtopic.php?p=1004707
I would suggest you to first take back up of the original data and then change the value
Maybe this:
On the menu bar, select File –> Options.
Click the “Database” tab.
Uncheck the “Stored Procedures” option.
Someone on another forum said that worked but he did not know why.
There is a setting in Crystal under File-->Options-->Database where one can set owner like %. Perhaps your Crystal install has an old setting limiting your visible schemas?
For any one in 2022 who is facing this problem. Check the following:
Open odbc, 32 bits odbc.
Select your datasource and click configure
Click details
Select Metadata tab
Uncheck Disable Schema support and click Ok.
Solved, this is tested and working

Automatic check out on Team Foundation Server using SQL Server Managment Studio

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.

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