Why is SQL Server Object Explorer in Visual Studio so slow? - sql-server

I just created a new SQL Server Database in Azure and then opened it in Visual Studio 2015 using the link in the Azure Portal. I had to add my IP to the firewall but otherwise the process went smoothly.
However, when I am trying to interact with the database server via SQL Server Object Explorer it is painfully slow. Expanding any of the folders in my Database (e.g., Tables folder) takes 10 to 30 seconds. The database is brand new, so the only things it has are whatever Azure creates when it instantiates a new DB.
This is the second Azure DB I have created and tried to view in Visual Studio and both have the same problem. With the first one I thought maybe I did something wrong during setup but this time I made sure to do everything by the book.
Running actual queries against the DB from within Visual Studio (right click the DB, New Query ..., select * from INFORMATION_SCHEMA.TABLES;) is very fast, so it doesn't appear to be a problem with my connection to Azure.
Why is it so painfully slow? What can I do to make it faster?
I am using Visual Studio 2015 Update 1 (14.0.24720.00) on Windows 10 (fully patched) and during database creation I checked the box to use the latest version.

SQL Server Object Explorer (SSDT) in Visual Studio builds a schema model of entire database when you connect a database first time. This is a concept of model based database development which provides benefits such as validating scripts against database without needing to modify the live database etc. When it comes to Azure SQL DB where the resource is limited with your database's pricing tier, the performance of executing queries to fetch database model can vary. Based on our performance tests, pricing tiers above S1/S2 provides a similar interactivity as local or on-prem SQL instance.
More in details, current SSDT's mechanism is to composite minimum number of queries to minimize the number of round-trip operations with SQL server/database hence each query execution time is longer. It affects the interactivity of SQL Server Object Explorer while the query is being executed.
To enhance, SSDT team is revising the design for Azure SQLDB to provide a faster interaction experience while keeping the benefit of model based database development.
Disclosure: I work on the SQL Data Tools team as a PM

Good tip from #eric-kang in his comment to use 'Server Explorer' instead of 'SQL Server Object Explorer' - this is much better for basic data queries as its actually usable in real time

Related

Why do I need SQL Server to install Azure DevOps?

I'm currently working on a enterprise that uses TFS 2017, and we pretend to upgrade to Azure DevOps. So far I'm just studying about how to implement this TOOL. I'm new on devops things and I have these following doubts... Why do we need SQL Server to install DevOps Azure? What kind of information are stored in there?
In the server configuration wizard, I have the option to select an existing database to use for the Azure DevOps Server that's being deployed... Can I select the currently database that's used by TFS 2017?
Azure DevOps Server and Team Foundation Server store just about everything in massive SQL Server databases.
The main server configuration is stored in the tfs_configuration database and each project collection is stored in a separate database The default is tfs_defaultcollection.
The collection database holds all version controlled files (TFVC and Git), all work items (Product Backlog, Sprints etc), Test Cases and all test run attachments, your Pipelines, Builds and Releases as well as all of the artifacts produced by these pipelines.
These databases can grow considerably.
Whether you can keep your current database server depends on what version you're currently running. SQL Server 2016 SP1+ happens to be supported by both Azure DevOps Server 2020 as well as Team Foundation Server 2017. You could keep using that for the upgraded installation.
But my recommendation would be to install SQL Server 2019, you'll get all of the performance and security benefits of the new server, support for the latest Windows Server platform, as well as a support window that matches your new Azure DevOps Server installation.
You can find the SQL Server compatibility matrix for TFS/ADS here:
Azure SQL Database and SQL Server
TFS 2017 was one of the last versions to require a database for the Warehouse, which is a form of replicated data. Reports can be written to pull data from the warehouse, without impacting the user experience. The database is somewhat deprecated now, especially for reporting. Microsoft promotes the use of the API to pull data from the live database. TFS does however still need its "live" database to store all of the data presented to users. These will be work items, discussion comments, project templates, user mappings to AD, amongst other things.
You will need to upgrade your 2017 Schema to conform to the new standard as defined by Azure, which will be taken care of as part of the upgrade.
What kind of information are stored in there?
Issues, templates, build results, lots of things.
Can I select the database that's used by TFS 2017?
Yes, that will be upgraded during the installation.

What is the difference between DBMS and Database IDE?

I have been using Microsoft SQL Server 2017 for a while (just DDL and DML) and recently decided to install JetBrains DataGrip because I thought it was another DBMS but with dark theme.
When I try to create a new database it tells me to assign a host/user/password/port and I cannot do anything because it can't "connect to the database". I've been using Microsoft SQL Server Management Studio 2017 and never needed to assign a port/password/host or anything? I just created a new database and started adding/filling tables. How does JetBrains DataGrip work?
I noticed that on the JetBrains DataGrip page it doesn't say it's a DBMS, it says it's a "Database IDE". I cannot seem to find information about this on the web.
When considering a RDBMS such as SQL Server, the core component is a service/engine which acts as an interface between the database (files) and end users or applications allowing database functions to be carried out.
SSMS (SQL Server Management Studio) is just one of many possible end users of the SQL Server Database, and happens to have be part of the SQL Server software suite. It should not, however, be confused with the database itself as SQL Server operates perfectly happily without ever seeing SSMS.
Any form of user interface tool for a database needs to know how to connect to the database it is going to manage. In your case you most likely installed the entire software suite with default settings and as such didn't need to know what they were. JetBrains DataGrip however does need these settings.
You can find out what your specific settings are by running the SQL Server Configuration Manager.
JetBrains DataGrip is just a Database IDE to connect to different database engines via only one environment without needing to install management tools for every database that you want to work with.

Azure SQL Database Management GUI, where is it?

Are we going back to green command prompts in place of the GUI. I like the cloud sql database but I also like the GUI of management studio of traditional SQL databases of the past. Its a major cut in productivity going back to scripting what you used to be able to see in a GUI. Visual Studio database designer fails almost 95% upon loading when connecting to an Azure cloud SQL database. In fact that surface designer will only load local databases and that is a 60 second plus struggle of crossing your fingers. So visual studio 2012 to 2013 is a not a valid until some awake folks at Microsoft decide to make that a working reality.
What work a rounds are there to view and/or design cloud SQL databases. Keys, constraints indexes, etc..
Looks like you can do it by latest update of SSMS 2014
SQL Server 2014 Management Studio - updated support for the latest Azure SQL Database Update V12 (preview)

How do visual studio 2013 data compare tool for Windows Azure?

Related : Visual Studio 2013 (Professional Edition)
I am trying to create Data Migration Script to deploy the changes on Staging Server.
This works locally fine. But When I try to run the generated Script on Azure Database, I get TextPtr is not supported on Azure platform. I studied more about it & found that the newer editions of SQL Server (sply for Windows Azure (SQL 2014 may be)) has dropped some keywords/functionalities the list can be found here.
The Sql Database Project only provides the Schema Compare, but Data Compare is avilables in tools Section (where we can not set Target Project Type property).
I wonder how can I deploy/Migrate the changes made in one environment to another in such a Situation. Currently I had to overwrite the existing Database on Azure platform.
But this is not Identical also, for first time this could work but not for later, as there could be some changes made to the Staging or other environments.
I had a similar problem, when trying to migrate between a test and staging environment in Azure. As a quick fix, I got around the problem by just doing a "copy" of the dev database via the Azure dashboard.

Missing Diagram folder in Database Explorer at Visual Studio 2012

I was in a middle of designing a website when suddenly Database Diagram folder just disappeared from the Database Explorer. I have no idea what happened and what to do right now, as I desperately need it to continue my work - adding tables to database manually are not an option for me.
I've been seeking for the solution for a whole day, and I even re-installed the Visual Studio and local IIS server, but it wasn't helpfull at all.
Is there any way to bring the feature back or at least is there any free tool that would work on Windows 8 x64 and has diagram-based database designer for MSSQL 2008?
EDIT
It seems that Microsoft removed the diagramming for purpose. Which is pretty logical in a business logic - why would somebody buy Server Management Studio if they have basic tool (diagramming) built in Visual Studio?
1) Database Diagram is a feature of SQL Server, not Visual Studio. I am not sure what VS uses to display that folder but you might want to verify with your DBA or check the configuration of the database to see if someone has not just disabled the ability to use diagrams. Have you tried refreshing your connection to the database server as well?
2) How is adding tables to a database manually not an option? If you get yourself dependent on doing things one way and only that one way you are setting yourself up for disaster in future projects, as you are in your current one. There are other ways from within VS to create a table, it just may not be a graphical picture that diagrams offers.
3) Have you looked at the database through SSMS to see if the diagrams folder shows up there?
Hello this has been my solution that worked for me and enabled me to use database diagram ide in visual studio 2012!!
First i installed SQL Server Management Studio. I then noticed that i still did not have SQLEXPRESS Service or SQL Agent Browser in my computer services either.. This was why i assume i couldn't login to any of the SSMS which was annoying. I then downloaded SQL Server Express R2 which then ran me though another setup which was fine. I did also choose to put a sql server password for SQL Server Express.
Once installed I double checked to make sure the services where running by right clicking MY COMPUTER / MANAGE / SERVICES -- scroll down till you see "SQL Server (SQLEXPRESS)" and make sure that the service has started and also "SQL Server Agent (SQLEXPRESS)" (this one was turned off when i checked) .. i was then able to login to SSMS without a problem.
I then created a new database, right clicked diagram like we always do in VS and created a diagram with two tables, created their relationships blah blah..
i then created a new website in vs 2012, i clicked "Connect To Database" in the SERVER EXPLORER"
I choose my server name, used windows authenication and selected the database i just created in SSMS.
Then to my suprise i now have database diagram designing in Visual Studio 2012.. Finally!
Thankyou microsoft for removing such a cool feature which now gives us developers a few things to do.
Hope this helps.

Resources