Evan Barke

SQL Server Commands – Dynamic SQL

July 4, 2014 by
Warning: This article contains examples of SQL injection. The example queries can be harmful to data and are run on the AdventureWorks2012 database DO NOT run equivalents on your production database. Backup your AdventureWorks2012 database if you don’t want to lose data. Please note that the techniques are purely for education purposes and we do not condone the use of them for any other purpose. Read more »
Sifiso W. Ndlovu

Background to exception handling in SQL Server

June 26, 2014 by
Since the advent of SQL Server 7.0, the best way of raising T-SQL related errors back to calling applications has been through the usage of the RAISERROR statement. Figure 1 demonstrates a combination of mandatory parameters (i.e. msg_id/msg_str, severity, state) as well as optional parameters (i.e. WITH option) that ought to be provided for the purposes of successfully using the RAISERROR function. Read more »
Evan Barke

SQL Server cursor performance problems

June 18, 2014 by

Introduction

In a previous article we discussed the how to set up a basic cursor. We explained that a cursor is a row-based operation that takes a given SELECT statement and breaks downs the processing of the data into looping executions. People that do not have the background in Database Administration or who did not enjoy database classes while studying will often find SQL Server cursors handy and fun to write. This is because they break free of the shackles of set-based logic that is the normal when writing most T-SQL scripts. It is for this reason that we so often find SQL Server cursors written into the business logic of an application and it is a real pity because they are real performance hogs. Yes, there are times when cursors are OK to use and they can be tuned slightly by playing with their different types but, as a general rule of thumb, one should try to avoid them at all costs. Read more »
Muhammad Imran

SQL Server Management Studio tutorial – Configuring the environment

June 11, 2014 by
Configuration of the application plays a significant role in any application, when installed. However, some applications are configured at the time of installation (with default settings) while in other cases, manual configuration is done to achieve its real benefits. In the case of SQL Server Management Studio (SSMS), it is configured by default with the standard settings, and it can be further configured to make the work easier.
Read more »
Evan Barke

SQL Server cursor tutorial

June 4, 2014 by

Introduction

Most people that work with Microsoft SQL Server will have at least heard talk of cursors and often, even if people know on a basic level what SQL Server cursors do, they are not always certain when to use them and how to write the code behind them. So this article takes a step back and provides an explanation as to what SQL Server cursors can be used for as well as a basic example that you can run for yourself to test. Read more »
Evan Barke

SQL Server Business Intelligence – Using recursive CTE and persisted computed columns to create a calendar table

June 2, 2014 by

Introduction

Those of you that have worked extensively with dates in SQL Server (or any other relational database management system (RDBMS)) will know how finicky and complicated it can be to use DATE functions, DATEPART, DATENAME, DATEADD, GETDATE(), CURRENT_TIMESTAMP etc. Personally, I find it very useful to have a calendar table that stocks all of the necessary, pre-calculated fields in one place. Whether you’re doing BI or web, it can be very helpful to have a fixed ID for a date in order to really optimize your data analysis and processing.
Read more »
Evan Barke

SQL Server Business Intelligence – Expanding fact tables in an established data warehouse

May 30, 2014 by

Introduction

As in often the case in life, things that sound simple are not always the easiest things to do. In computer science this is even more often the case. In fact, one of the most challenging things about information technology work is often the communication with bosses that know little about technology and require justification for time spent on seemingly simple tasks. However, by the same token, tasks that seem impossible to the untrained eye are often fairly straightforward and quick to implement and can earn you easy respect. Read more »
Sifiso W. Ndlovu

Columnstore Index in SQL Server

May 28, 2014 by

Prerequisite

The discussion pertaining to SQL Server 2012 columnstore indexing is better explained through theoretical and practical measures. Thus, for the practical measure part – I will be using the AdventureWorksDW2012 sample database. The rest of the prerequisites for a comprehensive understanding of this topic are as follows:
Read more »
Ivan Stankovic

SQL Server backup – models and types

May 26, 2014 by
A SQL Server backup is one of the most important features DBAs should fully understand and use. It’s not uncommon that the process of backing up SQL Server data is considered as simple and therefore easily overlooked as essential when it comes to disaster or other recovery scenarios. Realizing that a backup is not valid (outdated, corrupted, or even does not exist) at the moment when it’s needed is highly undesirable scenario for any DBA. Read more »
Ivan Stankovic

SQL Server Policy Based Management – Categories and Database Subscriptions

May 21, 2014 by
In the recent articles (see below) about SQL Server Policy Based Management, we have explained the terms used by the feature, how it can be used in different environments and for various scenarios. We have also described how its basic purpose, evaluating declared rules against specific SQL Server instances and their objects, can be extended on other aspects of SQL Server such as SQL Server Audit is. Read more »
Evan Barke

SQL Server Business Intelligence features – creating reports based on OLAP cubes

May 19, 2014 by

Introduction

In order to build a SQL Server business intelligence solution one needs to:

  1. Design a de-normalized data warehouse
  2. Build and schedule an Extract, Transform and Load (ETL) package that will feed the data warehouse at regular intervals with new data from the OLTP database.
  3. Setup, personalize and process a cube based on the data warehouse.
  4. Add the processing step to the ETL schedule to ensure the whole chain is automated.
Note: These steps are covered in detail in other articles in the series. If you do not yet have an OLAP cube set up and automated and you need more info as to how to do so; please refer back to the relevant step.
Read more »
Muhammad Imran

SQL Server Management Studio – A step-by-step installation guide

May 14, 2014 by
SQL Server Management Studio (SSMS) is the official and preferred client user interface which can be used to manage, configure, deploy, upgrade and administer a SQL Server instance. The tool interface is quite user friendly and comprehensive. It is shipped with every SQL Server version and is regularly updated and enhanced. If you are planning on learning how to use SQL Server from scratch, consider using SQL Server Management studio as a first step on your journey to learning SQL Server. Read more »
Page 44 of 48« First...102030...4243444546...Last »