Skip to content

Solve Common SQL Server Restore Issues

'Database backups and restores have many options in SQL Server. There are standard steps to implement backup and restore solutions, however in some situations additional knowledge is needed. Thus, understanding backup and restore processes is very essential for developers and DBAs to be more confident when dealing with uncommon situations and having the ability to suggest flexible solutions related to these processes.'...

https://www.mssqltips.com/sqlservertip/4110/solve-common-sql-server-restore-issues/

Viewing Statistics In SSMS

'I’m in the process of creating a post about statistics and came across something in SQL Server Management Studio that was driving me crazy. I thought I’d post it here so that others might not waste an hour or two like I did puzzling over this.

When you create in index in SQL Server, SQL automatically creates a statistic for the columns in the index. In the screenshot below, you can see my table named SJSTest, to which I have added a clustered index called, somewhat unoriginally, ClusteredIndex. When you expand the Statistics folder, you can see SQL has automatically created a statistic with the same name as the index.'...

http://shaunjstuart.com/archive/2016/07/viewing-statistics-in-ssms/

Split String Function

'This In-line Table Valued Function takes a string of values along with a delimiter and breaks the string into a table using recursion. Support has been added for text qualified strings as well as space and tab delimited records.

Using a numbers table, we are able to take advantage of Recursion in SQL Server to find our delimiter and leverage the SUBSTRING function to break the string into its individual components without requiring the overhead of a loop.

Once the function has been created, splitting strings is quite simple.'...

http://www.sqlservercentral.com/scripts/SUBSTRING/124330/

Query Performance Tuning – A Methodical Approach

'In both a recent article and a recent editorial I touched on the need to test and evaluate hard numbers when doing performance tuning. However the method of doing so may not be immediately obvious. So for this article, I’m going to take a moderately complex query and walk through a few attempts at tuning the query, showing tests at each step and evaluating each step for effectiveness.

Let’s start with the query. I’m using a padded version of the WebForums database and SQL Server 2014. The smaller version of the database can be downloaded from an old Simple Talk article, Finding the Causes of Poor Performance in SQL Server, Part 1. Here is the code I want to tune.'...

http://www.sqlservercentral.com/articles/Performance+and+Tuning/126532/

Another Query to Help Find the Right Event

'Finding the right event or combination of events to monitor may seem like quite a daunting task with so many events to explore and (frequently) too little familiarity with Extended Events. In this follow-up article to Extended Event Help Queries, I will share another means to quickly explore the Extended Events metadata in the effort to find the precise event to fit your needs.'...

http://jasonbrimhall.info/2016/07/21/another-query-to-help-find-the-right-event/

SQL Server Access Control: The Basics

'SQL Server provides a number of settings for controlling access to data, metadata, and other SQL Server resources. For those who are new to SQL Server security or don’t manage security routinely, configuring these settings can seem a complex and confusing process. If you get the settings right, everybody is happy, but if you get them wrong, your users might not be able to access the data they need or, worse still, unauthorized users might be able to get at sensitive information or carry out malicious attacks.'...

https://www.simple-talk.com/sql/database-administration/sql-server-access-control-basics/

SQL Server – Best Practices – Always use precise decimal data-types

'I recently came across a concrete example of something that has always been maintained as a best practice – when working on items that are sensitive to decimal precision, always use precise data-types like DECIMAL instead of FLOAT or REAL.

The following example clearly demonstrates that using a FLOAT in mathematical calculations may change the outcome of the computation. For financial calculations, this would mean incorrect reporting of revenues.'...

https://nakulvachhrajani.com/2016/01/25/0371-sql-server-best-practices-always-use-precise-decimal-data-types/

Best Practices For Deleting SQL Server Data

'Deleting data from a SQL Server database is something I really don't like to do as it's always better if it can be done through an application that has been thoroughly tested.  However, inevitably there comes a time where some backend data cleanup needs to be done. Below are some best practices I like to follow when deleting data.'...

https://www.mssqltips.com/sqlservertip/4109/best-practices-for-deleting-sql-server-data/