BCP is a utility that is installed by default with SQL Server editions and is used for bulk import or export of a large volume of data in user-defined...
Lately, I’ve been dedicating a lot of time to financial mathematics in Excel. I’ll try to leverage that and shift the focus from Excel to SQL Server. Perhaps someone...
In this short article I will introduce the possibility to run a sql script outside of SQL management studio using SQL server command line utility (sqlcmd for short). This...
In some situations, we need to get an overview of the data present in a table. Or perhaps we want to check if there are any duplicate values in...
What I have here today is a article for beginners. It will be full of sql query examples. We will start from the most basic ones and continue up....
Performance optimizing SQL queries is an ongoing battle that begins right from the design of the database architecture and server resource scaling. With the right architectural design, many performance...
OFFSET functions are relatively new to MS SQL Server. They are available since SQL Server 2012 version. These functions enable a user to “list” through rows of a table....
In the previous two articles, I covered setting up database mail (gmail) and configuring Change Data Capture (CDC), which is the automatic tracking of changes to a table. So,...
A database is a system of files and objects that are organized and linked within the database through keys. In SQL Server databases, you can find objects such as...
DBCC stands for database console commands, which are commands executed on a specific database. The DBCC command set allows you to perform various administrative operations or queries on databases...
IDENTITY is a property in SQL Server that allows for the automatic numbering of records inserted into a table. It creates an automatic increment with unique values without the...
A table without a primary key (clustered index) is referred to as a heap because it’s just a pile of unordered data. In contrast, a table with a clustered...
From time to time, it’s important to examine the database objects in terms of table size (number of rows and storage) to avoid some performance issues on server. How...
xp_cmdshell is a very powerful procedure that allows you to execute commands via the command-line (cmd) in SQL Server. With cmdshell, you can perform various operations on a Windows...
SQL Server Agent is a tool integrated into SQL Server that is primarily used for automating and scheduling tasks. Through SQL Agent, you can create Jobs and schedule individual...
In the previous article (see Index Fragmentation), I described how to detect index fragmentation using a script that utilizes system tables. According to Microsoft’s recommendations, we should reorganize (REORGANIZE)...