Understanding SQL Server ALTER TABLE ADD COLUMN Statement

Total: 1 Average: 5

This article describes the SQL Server ALTER TABLE ADD COLUMN statement. The purpose of this statement is to add a new column to an existing table. Also, the article will clarify the following use cases:

  1. Add multiple columns.
  2. Add a new primary key column.
  3. Add a new foreign key column.
  4. Add new columns that have computed columns.
  5. Add a new column that has CHECK and UNIQUE constraints.
Read More

SQL DROP TABLE Statement and Various Use Cases

Total: 1 Average: 5

The SQL DROP TABLE statement serves to drop the table from the database. It removes the table and its data and indexes associated with it. The statement is irreversible. Thus, you can restore the table only by restoring the backup.

This article covers the following cases:

  1. Delete one or multiple tables.
  2. Delete the table used in a View.
  3. Delete the table having a foreign key.
  4. Delete the table having clustered and non-clustered indexes.
  5. Delete the table from the replication setup.
Read More

Five Different Methods To Start, Stop, And Restart SQL Server Services

Total: 1 Average: 5

When we install the SQL Server, it also installs the following services:

  1. SQL Server database engine service to manage and access data in SQL Server.
  2. SQL Server Integration Service for the ETL process – we install it when including Integration services during setup.
  3. SQL Server Reporting Service to manage the SQL Server reports.
  4. The SQL Server Agent Service. Note that it is not available in the SQL Server Express edition.

In this article, we are going to learn the following methods to manage SQL Server services:

  1. Start, stop, and restart SQL Server services using the SQL Server configuration manager.
  2. Start, stop, and restart SQL Server services using Services MMC (Microsoft Management Console).
  3. Start, stop, and restart SQL Server services using the PowerShell script.
  4. Start, stop, and restart SQL Server services in Ubuntu Linux.
  5. Start, stop, and restart SQL Server services using the Windows server failover cluster manager.

Let us examine all these methods.

Read More

Manage MDF Files in SQL Server 2019

Total: 1 Average: 5

An SQL Server database contains primary data files, secondary data files (optional), and transaction log files.

The primary and secondary datafiles contain tables, database objects, schema, and data.

The file extension of the primary database file is *.mdf, and the file extension of the secondary data file is *.ndf.

The transaction log files store all the changes made by the transactions (insert, update, and delete). If the SQL Server restarts unexpectedly or crashes, the database engine rolls the incomplete transaction back before the point of failure using the Transaction log file.

The extension of the transaction log file is *.ldf. You might want to refer to this article to understand the Transaction Log Files architecture.

In this article, I am going to explain how we can manage the database files (MDF files) in SQL Server 2019.

Read More

SQL Server Express Edition: Installation, Benefits, and Limitations

Total: 0 Average: 0

The SQL Server Express edition is a free version of SQL Server 2019. You can use it to deploy small applications and websites and monitor the database mirroring instances. It also serves as a back-end of the third-party software. For example, if you plan to set up an SQL Server monitoring tool, and the data retention period does not exceed a week or two, you can use the Express edition to save the license cost.

Read More

How to Install Ubuntu 18.04 and SQL Server 2019 on Linux

Total: 0 Average: 0

The previous article explained the creation of a virtual machine using Oracle VM Virtual machine. Now, we will learn how to install Ubuntu 18.04 and SQL Server 2019 on Linux.

Install Ubuntu Linux

First, we need an operating system ISO file. Once the file is downloaded, we mount it on a virtual disk drive:

Launch Oracle VM Virtual Machine Manager and right-click on LinuxSQL01. Then click Settings.

Read More