In this article, we are going to learn about the windows internal database. Microsoft windows server and their components use the Microsoft WID database to store their data. It is used to store the relational data of the following services:
Read more »Utilities
Automate the SQL Server DBCC CheckDB command using Maintenance Plans
August 19, 2021In this article, I am going to explain how we can create a maintenance plan to automate the SQL Server DBCC CheckDB command.
Read more »Understanding SQL Server DBCC DBREINDEX command and its usage
August 2, 2021In this article, I am going to explain the DBCC DBREINDEX statement, its syntax, and its usage. Additionally, I am also going to cover the differences between the DBCC REINDEX and ALTER INDEX statements.
Read more »Understanding xp_fileexist and its usage
July 9, 2021In this article, we are going to learn about xp_fileexist, its usage, and alternatives. To access the file system using SQL Server queries, we can use the following extended stored procedures.
Read more »An overview of the sp_helptext statement
June 28, 2021In this article, we are learning about the sp_helptext statement. I am going to show the various examples of the usage of it. I will also explain the two alternatives of the sp_helptext statement.
Read more »Different ways to check SQL Server uptime
April 26, 2021In this article, we are going to explore different ways to check the SQL Server uptime. We can determine SQL Server uptime by using any of the following methods:
Read more »T-SQL scripts to update statistics based on the row modification
December 24, 2020In this article, we are going to learn how we can develop a T-SQL script to update statistics of tables based on the row modification. It is always a challenging task to perform maintenance on a table that has billions of rows. During the early years of my professional career, I was assigned a project and one of our clients had performance issues. The initial analysis showed that due to frequent data modifications, a specific table’s statistics become outdated.
Read more »Identify unused SQL databases
December 8, 2020In this article, I am going to show how we can identify unused SQL databases. In our organization, after release deployment, we receive the database refresh requests. To refresh the database, we were instructed to perform the following tasks:
Read more »Configure ODBC drivers for MySQL
August 5, 2020In this article, I am going to explain ODBC drivers. We will go through the process to set up the ODBC driver for MySQL and use it to create an SSRS report. First, let me talk about ODBC drivers.
Read more »Getting Started with the SQLPackage Utility
May 28, 2020In this article, I’m going to explain in detail about the SQLPackage utility that is provided by Microsoft in order to automate database deployments. In my previous article regarding Data-Tier Applications in SQL Server, I have mentioned how to create a DACPAC and a BACPAC file from an existing SQL Server Database. The underlying technology behind creating the DACPAC and the BACPAC files is the SQLPackage utility, which helps to create those files.
Read more »An overview of the SQL Server Profiler
December 9, 2019In this article, we will describe SQL Server Profiler and how it can be used. In addition, we will mention the tools that are integrated with it- plans about its deprecation, and what are the alternatives?
Read more »SQL Unit Testing: Working with exceptions
May 21, 2019With this article, we will complete our journey with SQL Unit Testing. But first, let’s remember the main theme of the SQL Unit Testing again briefly. With the help of the SQL Unit Testing, we can detect and find out the flaws and bugs in database projects. This reduces the possible loss of time and money and reputation during the use of the product. However, it should be kept in mind that no matter how many tests are carried out, there will still be some bugs in the project, but SQL unit tests provide a greater degree of confidence. The fact that there are no bugs or flaws in the application at that time does not mean that the application is perfect. We cannot test all combinations and probabilities of the database objects. That is why in real life, considering certain parameters (risk, priority, etc.) we must ensure that a “reasonably sufficient” test is done.
Read more »SQL Unit Testing Mocking Stored Procedures
May 8, 2019In this SQL Unit testing article, we will continue our journey with SQL unit testing. In the previous articles of this series (see the TOC at the bottom), we mentioned about SQL unit testing essentials and designing approaches as well and then we reinforce these notions with various tSQLt framework practical examples. In this article, we will continue to learn how to mock stored procedures in the tSQLt framework and we will provide it with two examples.
Read more »How to use fake functions with SQL unit testing?
April 30, 2019In this article series, we are exploring SQL unit testing, in general, and also we are reinforcing details and topics with various practical examples. We are using the tSQLt framework because it is the quite powerful and handy tool in order to develop and code SQL unit tests.
Read more »How to use fake tables in SQL unit testing?
April 22, 2019In this article on SQL unit testing, we will talk about how to isolate SQL unit tests from dependencies and how to use fake tables in SQL unit tests, so that we will able to develop more robust and less fragile SQL unit tests.
Read more »SQL unit testing best practices
April 8, 2019SQL unit testing is a testing method which allows us to test the smallest, atomic programmable part of a database object. SQL unit testing plays a key role in the modern database development cycle because it allows us to test individual parts of the database objects work as expected. SQL unit testing adds a great worth to the database project because unit tests are more reliable then manual test methods.
Read more »SQL Unit testing with the tSQLt framework and SQL Server Database Project integration
March 25, 2019In the previous article SQL unit testing with the tSQLt framework for beginners in this series, we covered tSQLt framework essentials and installation. we also demonstrated basic SQL unit testing through the tSQLt framework. In this article, we will continue to explore SQL unit testing and we will also discuss the benefits of SQL unit testing. Additionally, we will learn how we can use the tSQLt framework in a SQL Server Database Project.
Read more »Continuous Database Delivery (CD) using SQL Server Tools SqlPackage.exe
August 14, 2018A 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:
- The Database Management Life Cycle
- Complexities of the database release management process
- Introduction to SQL Server Data Tools and SqlPackage
- Using SqlPackage.exe, with examples
The BCP (Bulk Copy Program) command in action
August 13, 2018There are various methods available for bulk data operations.
- BCP utility
- BULK INSERT
- Using OPENROWSET
- 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, 2018This 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:
- How to enable SQLCMD
- A few important points to remember
- SQLCMD with scripting variables in SSMS
- Passing variables (or argument) as T-SQL and or a SQL Script file
- SQLCMD with scripting variables and Windows scripting in SSMS
SQL Server utilities you probably didn’t know about – SQLdiag, osql and SqlLocalDB
October 26, 2017Introduction
There are several tools included in SQL Server on-premises that you may not know.
In this article we will explain the following tools:
- SQLdiag
- osql
- SqlLocalDB
After reading this article, you will learn how to use them and understand what are they for.
Read more »