SQL Server instances are generally poorly-documented. How easily can you tell if something has changed? How easily can you check that there is adequate space for growth? Are you up-to-date with licenses? What errors are happening? Who has accessing the system? Before PowerShell, it was difficult to be on top of all this. Now you can, with the help of Sander's database documenter.… Read more
To design, or redesign, a database of any complexity, the Entity-Relationship modelling tool becomes essential. The specialized tools that have dominated the industry for a long while are expensive and are installed on a workstation. Now that browser technology has progressed so rapidly, the online database modelling tools have become viable and are starting to attract the attention of database designers. Are they good enough to use now? Robert Sheldon finds out.… Read more
It sometimes pays to go back and look at what you think you already know about SQL. Joe Celko gives a quick revision of the GROUP BY and HAVING clauses in SQL that are the bedrock of any sort of analysis of data, and comes up with some nuggets that may not be entirely obvious… Read more
When maintaining or refactoring an unfamiliar database, you'll need a fast way to uncover all sorts of facts about the database, its tables, columns keys and indexes. SQL Server's plethora of system catalog views, INFORMATION_SCHEMA views, and dynamic management views contain all the metadata you need, but it isn't always obvious which views are best to use for which sort of information. Many of us could do with a simple explanation, and who better to provide one than Rob Sheldon?… Read more
You can develop a Power BI Dashboard that uses an R machine learning script as its data source and custom visuals. Here is a simple example that shows how to connect to data sources over the Internet, cleanse, transform and enrich the data through the use analytical datasets returned by the R script, design the dashboard and finally share it.… Read more
The SQL Server 2016 Query Store provides several new ways of troubleshooting queries, studying their plans, exploring their context settings, and checking their performance metrics. In using the Query Store to ensure that performance is as good as possible, it isn't long before it becomes important to be familiar with the DMVs that are associated with the query store, and using them in custom queries.… Read more
Although SQL Server Data Tools (SSDT) encourages 'disconnected' database development, it also provides the SQL Server Object Explorer (SSOX) tool in SSDT's Visual Studio shell to connect to a live development instance or view an SSDT project once all references have been resolved.… Read more
When starting out with PowerShell, it is hard to escape from the detail to work out the best strategy for creating scripts. Laerte explains how, when and why it pays to think in terms of versatile functions to meet varying demands.… Read more
Although SQL is an obvious choice for retrieving the data for analysis, it strays outside its comfort zone when dealing with pivots and matrix manipulations. R includes a number of packages that can do these simply. By combining the two, you can prepare your data for analysis or visualisation in R more efficiently.… Read more
One of the most important features of the SQL Server 2016's new Query Store is the reporting. With these features, it is now possible to get a wealth of information on how your query workload is performing, either aggregated for the entire query workload or for a single query. With this information, you can see the effects of 'forcing' an execution plan for specific queries and get feedback of the consequences.… Read more
At last, SQL Server has caught up with other RDBMSs by providing a useful measure of JSON-support. It is a useful start, even though it is nothing like as comprehensive as the existing XML support. For many applications, what is provided will be sufficient. Robert Sheldon describes what is there and what isn't.… Read more
There are several ingenious ways of using SQL References to enforce integrity declaratively. Declarative Referential Integrity (DRI) is more effective than using procedural code in triggers, procedures or application layers because it uses the SQL paradigm, thereby making optimisation easier and providing clearer expression of the rules underlying the data.… Read more
In SQL, you can express the logic of what you want to accomplish without spelling out the details of how the database should do it. Nowhere is this more powerful than in constraints. SQL is declarative, and Joe Celko demonstrates, in his introduction to Declarative SQL, how you can write portable code that performs well and executes some complex logic, merely by creating unique constraints.… Read more
PowerShell is like any computer language: you must understand the paradigms, the constructs, and the way it is designed to work to get the most value from it. It is no good just translating 'sausage-string' procedural algorithms. To demonstrate how PowerShell should be used as its' creators intended, Laerte Junior shows the difference between PowerShell problem-solving with, and without, PowerShell paradigms.… Read more
PowerShell is an ideal tool for doing health checks of a collection of SQL Server instances, and there are several examples around, but few acknowledge the fact that individual DBAs have their own priorities for tests, and need something easily changed to suit circumstances. Omid's health check allows tests to be SQL or PowerShell and requires only adding, altering or deleting files in directories. … Read more
SQL Server's Query Store, introduced in SQL Server 2016, helps to troubleshoot query performance by capturing a range of information about query usage, CPU, memory consumption, I/O and execution time, and retaining every Execution Plan for analysis. Much of this information is available through queries.
It looks set to be the most significant enhancement of SQL Server 2016.… Read more
SQL Server Data Tools (SSDT) provides, via the DacPac, interesting support for verifying not only those references within the database, but also those to other databases even if they are on other servers. Although it is adds an extra level of complexity to deployments, it can increase the probability that deployments will succeed without errors due to broken references or binding errors.… Read more
There may be some people who enjoy repetitive typing, but Grant Fritchey doesn't. He's always preferred SQL Prompt. The standard snippets suit developers fine but aren't so DBA-oriented, so he set about asking the SQLServerCentral community what they typed in the most, and set about producing a set of DBA snippets with the results. … Read more
When you use AdventureWorks as a practice database, have you ever looked at the code and thought 'what idiot did this', or 'what did the DBAs think when they saw that?' Subconsciously, you occasionally forget it isn't real and 'fill in the back-story'. The SQL Release Team at Redgate did the same with their own practice database, and imagined a cast of characters wrestling with the difficulties of deploying it.… Read more
There are more exciting things in life than unit testing SQL Statements, checking the results, timings, and execution plans. Phil Factor demonstrates a PowerShell-based technique taking the tedium out of testing SQL DML.… Read more