Renaming Indexes with sp_rename Procedure

Total: 2 Average: 5

Not so long ago, I was working on a project where we needed to change the data type of a table. The table had millions of rows, and we decided to create a separate table using the existing table definition and insert the rows into that table. After exporting data into the new table, we renamed the old table, constraint, and indexes using the sp_rename stored procedure.

The current article is dedicated to the ways of renaming indexes. 

Read More

Learn to Multicast Data Using SSIS Packages

Total: 1 Average: 5

This article describes configuring the job of multicasting data with the help of SSIS (SQL Server Integration Services) Packages. Also, it highlights the importance of Multicast Transformation in SSIS for sending data to multiple destinations as per requirement.

Additionally, we are going to explain the benefits of multicasting data and provide some professional tips.

Read More

How to Count the Number of Rows in SQL Server Table

Total: 1 Average: 5

Recently, I was working on a database performance improvement project. One stored procedure there was causing issues. In its code, a query populated the Count of the rows and stored the value in a local variable. That query was scanning a large table. Due to that, resource utilization became significantly higher. To fix the issue, we removed the faulty code and used the SQL Server catalog views to generate the Count of rows of the table.

Read More

5 No-Hassle Tips to Run SQL UPDATE with JOIN

Total: 1 Average: 5

“Oops! My bad.” How many times did you say this after an SQL UPDATE had gone wrong? The thing is, if you aren’t careful, a table update can have serious consequences in the form of the DELETE statement. It could become even worse if you complicate it by using UPDATE with JOIN. That’s why you need to think it over before hitting Execute or pressing CTRL-E.

So, today you will learn how to code your SQL UPDATE with JOIN without hassles and never say “Oops! My bad” again.

Read More

MIN and MAX Aggregate Functions in SQL Server

Total: 3 Average: 5

SQL Server Functions

In database systems in general and in SQL Server in particular, functions are pieces of code that take zero or one input and return a single output or an array.

Table-Valued Functions which are typically user-defined can return an array, but in-built SQL Server functions are typically Scalar-Valued Functions. The third class of functions in SQL Server are Aggregate-Valued Functions. The MIN and MAX SQL Server functions are Aggregate-Valued Functions.

Read More