User shortcuts setting in SQL Server Management Studio 2014? - sql-server

Do you know where in SSMS 2014 can I set up my own shortcuts?
For example: in ORACLE SQL I set up that
sf = select * from
By this I only wrote in execution window sf and it wrote select * from.
Where and how can I set it in SSMS 2014?
Thank you.

SQL Server doesn't have shortcuts. SSMS is a separate product, based on the Visual Studio shell.
SSMS is a separate free product now, which supports all SQL Server versions from 2008 upwards (including SQL Server for Linux). The latest update came out on December 5. Updates are released regularly every month.
It has the same shortcut functionality as Visual Studio. You can change and define new shortcuts from Tools > Options > Environment > Keyboard
You can specify snippets in the Code Snippets Manager, Tools > Code Snippets Manager whose shortcut is Ctrl+K, Ctrl+B. You can insert a snippet by hitting Ctrl+K, Ctrl+X
There are several tutorials that explain how to use Code Snippets, eg Add T-SQL Snippets from the docs, Getting started with Code Snippets feature of SQL Server 2012, the similar SQL snippets in SQL Server Management Studio
It is a good idea to install the latest SSMS version. Now that it's a separate product, earlier versions won't get the same updates as the current one

Related

SQL Server Reporting Services (SSRS) installation and configuration?

I have installed SQL Server 2014 and Visual Studio Professional 2015. So, does that mean it already has SSMS pre-installed with it, or it needs to be done separately.
My need is: Report generation using SSMS, from data coming from query behind SQL Server.
So, what needs to be exactly done to configure SSMS into SQL Server with VS 2015.
Upon deep diving even more, got the answer.
Option One: Google for 'SQL Server Data Tools' installer, compatible with your VS. Run the Installer.
Option Two: Open Visual Studio 2015 - Tools > Extension and Updates. Find/Search for 'SQL Server Data Tools' update option. Run it.
I'm still not sure if there comes a complete package of Visual Studio along with Data Tools, but I don't think it does. As we still need to add certain packages into VS Installer as per need.

SQL Server Compare Schema in Visual Studio 2017

I am attempting to compare schemas of two databases on the same server.
The two databases are named benchmarkdb and benchmarkdb_dev.
In Visual Studio 2017, I go to Tools > SQL Server > New Schema Compare...
From both drop down menus labeled "Select Source" and "Select Target" (as seen in the picture below), I want to select benchmarkdb as source and bencmarkdb_dev as target.
After clicking to select a source, the "Select Source Schema" pops up, and I clicked the "Select Connection..." button, which brought another popup. The newest popup (the one on the right in the picture below) shows both databases I am trying to compare.
However, after I choose one for either the source or the target, all pop ups close, but nothing populates the "Select Source..." or "Select Target..." drop down menus. In fact, it just goes back to looking like the first picture.
Is there a solution to this so I can compare the schemas between the databases?
Update:
I have tried this on VS 2012, 2015, and 2017. All are facing the same issue. VS software and system software are up to date. Below are some versions of software that I am using, if it is any help.
Windows 7 Enterprise SP1
VS 2012, 2015, and 2017
SQL Server 2014
.NET Framework v4.7.02053
OK, so I managed to fix it.
First off, you need to install SSDT from Microsoft pages. Just google it.
Make sure that you also have it listed in individual components when starting Installer (on Modify). Only SQL Server Database is required (I could choose from Integration Services and 3 more).
Next, you need to "Remove connection from history" in Schema Compare modal for connection selection.
I closed VS at this point, to make sure that the connection is not in history anymore.
Starting VS the next time, you should not have the problematic connection in history.
Recreate the connection (I checked "remember password") and voila. Schema compare works.
Not really sure, but in desperation I also installed "Redgate ReadyRoll Core", "Redgate SQL Prompt Core" and "Redgate SQL Search".
I don't think it matters, but if all else fails...
Edit: This worked on 2 machines and it doesn't seem to be connected to VS version.
I had the same issue, but I don't know if I had the same root cause.
My problems started after changing my database from SQL Server on a Window Server to SQL Server on a Linux Container. The schema compare would appear to accept my selection but the database field would never actually populate and I could not perform a comparison.
There were 2 things I had to do to solve the problem.
Update Visual Studio (using the standard updater within Visual Studio).
Update the SQL Server Development Tools (SSDT) add-on for Visual Studio to a preview version that supports SQL Server on Linux. That download is available here.
After both updates were in place I could select the database and execute Schema Comparisons between my project and SQL Server on Linux exactly as I had been doing for SQL Server on Windows.
If running a local database, check what version of SQL Management studio you are using
I had the same issue running Visual Studio Pro 2017 and SQL management studio v18.6 with SQL Server 2017 installed.
I tried all of the above solutions and no luck
Even going back to Visual Studio 2015 didn't work for me. What did work though was changing back to SQL Management Studio v17.9.1
No issues any more.
I may try to upgrade Visual Studio to 2017 again to see if that works now

General questions about SQL Server in Microsoft VIsual Studio 2015

I would like to start learning about SQL Server projects development, I have installed Microsoft Visual Studio 2015 which includes some tools for SQL Server development. However it seems to me that some of the features found in SQL Server Express are not supported in Microsoft Visual Studio.
For example when I create a new view in Visual Studio SQL objects explorer there is no option to open a view designer, the only way I can create a view is by typing SQL instruction, i.e. there is no GUI for that purpose, although my studying materials indicate that there should be a view designer GUI.
No option to open a view in design mode, most of the buttons are grayed out
Also the commands for view, query and table design are always grayed out. Why?
Should I switch to SQL Server 2016 Express if I want to focus on learning about SQL or Microsoft Visual Studio offers the same functions and I simply can't find them?
Thank you.
For Data related work i always used MS SQL Server and if you want to study SQL Server then you should also do practice on SQL Server because somewhere i read that VS studio does not support "Script AS" kind of thing.
For you specific query for view creation there is GUI in SQL Server for VIEW creation where you can select required tables and functions to be used in your VIEW.

Index GUI Issues with SSMS 2014 and 2016 when working with SQL Server 2005

We currently work with all versions of SQL Server from 2005 onwards. To save time I try to do everything in a single version of Management Studio. This also helps if running newer client operating systems like Windows 10 which old client tools aren't compatible with.
Specifically when trying to view the graphical SSMS interface for index properties I get the following error if connected to a SQL Server 2005 instance.
In Object Explorer:
Database > Table > Indexes > Right Click > Properties
Full error text:
TITLE: Microsoft SQL Server Management Studio
Exception has been thrown by the target of an invocation. (mscorlib)
ADDITIONAL INFORMATION:
Cannot read property IsSparse. This property is not available on SQL Server 2005. (Microsoft.SqlServer.Smo)
This also happens in SSMS 2014, but not SSMS 2012.
So my question is; can something be done to work around this issue allowing one version of management studio to be used for all versions of SQL Server from 2005 onwards?
I'm guessing now, but as it works in SSMS 2012 there must be something going on that targets an older version of mscorlib. Maybe because SSMS 2012 uses a VS2010 shell and different .Net framework?
Many thanks in advance for your time.
There is an Active feedback about that on Microsoft Connect here. Someone suggest a workaround to go into Table Design and go to menu "Indexes/Keys...". It works, but some properties are not editable that way, like Included Columns. The other options left are to use SSMS 2005-2012 or use T-SQL script, like Aaron said.

SQL Database Tools in Visual Studio 2012

I'm trying to setup my Visual Studio Project to be able to use only one IDE for managing SQL objects using TFS 2012. Is there any way to configure my project connected to a source control and if for example I go to SSMS and try to modify a stored procedure, automatically takes the one in the source control or vice versa using Visual Studio 2012 check out a procedure and from SSMS shows me that is checked out?
No matter where I'm (Management Studio or Visual Studio 2012)the SQL objects are synchronized.
Thanks
Microsoft doesn't provide any built-in support but you can link your SSDT database project to SSMS using the latest version of SQL Source Control, which is a commercial tool developed by Red Gate, the company I work for. Steps are:
Download SQL Source Control and install it (it has a 28-day free trial)
Load SSMS, right click on your database in the object explorer and select the Link to Source Control option.
In the Link dialog, browse to the database project folder in your repository.
That's it. It's now set up. Simply use the Commit and Get Latest tabs to keep your database in sync with your database project in source control.
I'd be happy to assist should you hit any problems. Please add a comment to this answer or contact support#red-gate.com

Resources