How to integrate Power BI data alerts into Slack

August 31, 2018 by

There is a growing trend among professionals and entire companies to move away from email as a primary means of communication and are even adopting alternative technologies. One of the most popular of these is Slack. Slack is a new kind of messaging and communication platform between colleagues, team or community members that allows them to integrate a lot of services including Visual Studio Team Service, Jira and GitHub.

Read more »

SQL Server Setup – Instant File Initialization (IFI)

August 31, 2018 by

If SQL Server needs to allocate space, first it fills the space it needs with zeros. Examples of when it needs to allocate space are creating/restoring a database, growing/allocating data and log files, and finally the troublesome auto growth operation. However, most of these slowdowns/long running actions can be improved by enabling instant file initialization. I say most because the one case where this is required is on log file growth. However, even when Instant file initialization has been enabled the log file will be zeroed out before the space is usable for SQL Server.

Read more »

SQL Server Dedicated Admin Connection (DAC) – how to enable, connect and use

August 31, 2018 by

The dedicated admin connection (DAC) can help you out of a sticky situation. This was built to help you connect to SQL Server and run basic queries in cases with critical performance problems. This works by telling SQL Server to reserve a thread specifically for processing your queries in an emergency. While it does reserve a connection for you, it is only one thread, there is no parallelism happening here, in fact, you will receive an error.

Read more »

How to setup custom SQL Server transactional replication with a central publisher and multiple subscriber databases

August 29, 2018 by

In this article, you’ll learn how to setup a simple, custom distributed database replication system.

Introduction

In general, a typical setup of transactional replication model of a central publisher with multiple subscribers includes the creation of a replica database(s) which may serve multiple purposes including:

Read more »

Performance troubleshooting when the query plan from the application is different than SSMS

August 24, 2018 by

Troubleshooting performance issues in a database is one of the main jobs of DBAs and by now most can trace the problem back to a query which is either running to slow or is causing a blocking issue on a key table. However, what is often not known is why this doesn’t cause problems in SSMS or why you don’t get the same query plan as what is inside the app. For example, in your extended event trace you see the query running longer from the application when compared to SSMS.

Read more »

How to continuously read Transaction log file data directly in a SQL Server database with fn_dblog and fn_dump_dblog

August 23, 2018 by

Outline

In this article, we’ll discuss how to read SQL Server transaction logs. This article should provide and insight into how the workload is being captured in the transaction log files. We are going to see how to get the transaction meta-data details and the history of the data will give us a clear idea of how the system is working and helps to decide peak usage hours, also helps to log information about who is doing what?

Read more »

How to handle SSRS multi-value parameter filtering in SQL Server Parallel Data Warehouse

August 23, 2018 by

Experienced business intelligence (BI) developers would tell you that as you move from one project to another, some requirements start becoming repetitive like you have dealt with them before. One such repetitive requirement occurs during SQL Server Reporting Services (SSRS) development wherein a client would request that a report parameter be configured to allow multiple values from a dataset that is populated by stored procedure, as illustrated in Figure 1.

Read more »

How to set up a DDL and DML SQL Server database transactional replication solution

August 22, 2018 by

In the article How to setup SQL Server database replication for reporting Server we discussed all about setting up a simple SQL Server transactional replication environment. In this article, we’ll simulate a more robust system that replicates faster and includes both DDL and DML statements. We’ll walk-through the steps to setup a dynamic transactional replication.

Read more »

How to collect performance and system information in SQL Server

August 16, 2018 by

Introduction

In this article, we’re going through many of the tools we can use for monitoring SQL Server performance. SQL Server is chock-full of lots of good reports that allow a DBA to quickly spot whether there is any current performance bottleneck on the SQL Server. Many of these sit on top of DMVs but they give us a visually interactive way to look and work with the data. We’re going to start with SQL Server Performance Dashboard Reports.

Dashboard Reports

Let’s jump into SQL Server Management Studio (SSMS) and the first thing we’re going to take you through out-of-the-box dashboard reports of all levels. They can be found by right-clicking the SQL Server instance in Object Explorer, and from the context menu, you’ll find Reports > Standard Reports:

Read more »

Shrinking your database using DBCC SHRINKFILE

August 16, 2018 by

Introduction

SQL Server is pretty good at managing disk space. As long as we do our part to set up appropriate storage types and place files and filegroups properly and set reasonable AUTOGROW settings, it’s almost a set-it-and-forget-it operation. Mind you, I said, “almost!” Sometimes, things do go BUMP! in the night and we need to act. Here’s what happened to me not too long ago:

Read more »

SQL Server database migrations with zero data loss and zero downtime

August 15, 2018 by

The growing importance and complexity of data migration, in an era of exploding data volumes and ever-changing business requirements, means that old approaches will no longer get the job done. We are in a world where everything needs to run instantly. Every Database Administrator or Developer would have definitely heard about database migrations with zero downtime and with zero data loss.

Read more »

Getting started with Azure Data Studio (ADS); initial installation and configuration

August 14, 2018 by

Microsoft Azure Data Studio is a new GUI-based (vs CLI) lightweight tool for developing and managing your modern SQL databases. The tool resembles Microsoft’s lightweight code editor, the open source IDE Visual Studio Code in terms of functionalities and the UI in general. If you’ve used Visual Studio Code (or VS Code), you’d feel at home with Azure Data Studio. Azure Data Studio also integrates really well other products like Azure SQL Database and Data Warehouse has been made very simple. Azure Data Studio is a cross-platform tool available for Linux, Windows, and Mac to manage the SQL Server databases. You can go ahead and download Microsoft Azure Data Studio to try it out!

Read more »

All about MSSQL-Scripter, the SQL Server cross-platform scripting Tool

August 14, 2018 by

One of the major challenges we face today, in the software development lifecycle, is with respect to development and deployment. As applications are deployed by moving various pieces of the SQL code between several versions, configuration, different editions, and sometimes even different platforms, deployment becomes daunting. In my opinion, scripting helps a lot and can really “grease the wheels” with addressing many scenarios that involve such complexity.

The importance of database level scripting is high, but it is getting easier by the day. Scripting is a process of generating a text file that contains the data structures and data from the database objects.

So, do we have a SQL native tool which serves the various purposes and usage? In some cases, the answer’s a yes, and in others, it’s a no.

Read more »

Continuous Database Delivery (CD) using SQL Server Tools SqlPackage.exe

August 14, 2018 by

A little curiosity on my part led me to research a little further on the available pieces of SQL Server Tools. A cross-platform tool for continuous integration and deployment, called SqlPackage, is part of SQL Server Data Tools. I picked it up because continuous integration, delivery and deployment are now must-have in the modern-day application development paradigm.

We’d talk about the following in this article:

  1. The Database Management Life Cycle
  2. Complexities of the database release management process
  3. Introduction to SQL Server Data Tools and SqlPackage
  4. Using SqlPackage.exe, with examples
Read more »

The BCP (Bulk Copy Program) command in action

August 13, 2018 by

There are various methods available for bulk data operations.

  1. BCP utility
  2. BULK INSERT
  3. Using OPENROWSET
  4. Import/Export wizard

The BCP (Bulk Copy Program) utility is a command line that program that bulk-copies data between a SQL instance and a data file using a special format file. The BCP utility can be used to import large numbers of rows into SQL Server or export SQL Server data into files. The BCP data files don’t include any schema details or format information. Hence, it is recommended to create a format file to record the data format so in case of any failures, you can refer to the format file and better understand the data format to determine what may have gone wrong..

We’ve been using the BCP tool for a long time, the reason being that it has a very low overhead, and works great for bulk exporting and importing of data. It is one of the most efficient ways to handle bulk import and export of data.

Read more »

Overview of the SQLCMD utility in SQL Server

August 13, 2018 by

This article is aimed at helping you understand the sqlcmd utility. Of course, this is a tool most of us have used it at several occasions given that the tool has been around for a decade now. However, to be a solid starting point, this article contains some examples that help you understand the tool from different viewpoints.

This article discusses the following:

  1. How to enable SQLCMD
  2. A few important points to remember
  3. SQLCMD with scripting variables in SSMS
  4. Passing variables (or argument) as T-SQL and or a SQL Script file
  5. SQLCMD with scripting variables and Windows scripting in SSMS
Read more »