In this article, I am going to explain some of the advanced usages of data-tier applications in Visual Studio. In my previous article, Working with Database Projects, I have explained how you can start building your database applications for SQL Server and Azure SQL Database using Visual Studio. This article will specifically focus on using SQLCMD variables and Publish Profiles of the Data-Tier Application development. For a better understanding, I would recommend reading the previous article and it will help to clear the basic concepts.
Read more »SQLCMD
Identify unused tables of SQL databases
September 24, 2020In this article, I am going to demonstrate how we can identify the unused tables of a given SQL Database. As a database administrator, we must maintain the tables and objects of the SQL Database. In my organization, when we add a new column or change the data type of a column, we export the data of the existing table in the backup table. Often, we forgot to review and maintain those backup tables. So as a solution, we decided to create a SQL Job that populates the list of unused tables and email the list to the DBA Team for review.
Read more »Add or remove a node from SQL Server Always On Availability Groups using T-SQL scripts
July 29, 2020This is the 7th article in the series of SQL Server Always on Availability Groups.
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
Discussing Backup and Restore Automation using SQLCMD and SQL Server agent
May 3, 2018Database administrators are often requested to refresh a database, mostly to create a live copy of the production database to the test or development environment. This is done so that the development or the test environment closely resembles the production environment; this way, we prevent many undesirable issues when running the application in the production environment.
Many developers, at times, are required to write and debug code on the production copy of the database, so it makes more sense to refresh the database on regular basis.
Read more »Working with the SQL Server command line (sqlcmd)
October 18, 2017Introduction
Sqlcmd allows executing queries, T-SQL sentences and SQL Server scripts using the command line.
In the previous article How to work with the command line and Azure to automate tasks, we worked with the sqlcmd in Azure.
In this new chapter, we will show the following examples in a local SQL Server using sqlcmd:
Read more »How to use SQLCMD commands in the SSMS query editor
December 13, 2016SQLCMD Mode allows creating, testing, executing SQLCMD commands or scripts in SQL Server Management Studio directly in the query editor. This option is available since SQL Server 2005.
Read more »