bulk rename columns

How to bulk rename column names in a database in SQL Server

Today, I had a nice challenge, how to bulk rename column names in a database. The issue was I needed to move few tables from development environment to production environment and since some of the tables were imported from other environments, several column names needed to be standardized before the transfer. To better illustrate this...Continue reading

copy database diagrams on the same SQL Server

How to copy database diagrams on the same SQL Server Instance

I recently built a SQL Server 2016 production database from a development database. Unfortunately, the database diagrams that had been created in the development database were lost. Since the new and the old database both contain the same tables and schema objects, I decided to copy database diagrams from one database to another. Sysdiagrams is a table...Continue reading

sp_who vs sp_who2

What is the difference between sp_who vs sp_who2 in SQL Server Instance?

When deciding whether to use sp_who or sp_who2, check the table below for a detailed comparison list. The main difference between the two commands is this: sp_who is documented and officially supported. sp_who2 is undocumented and therefore unsupported but commonly used. As you can see on the comparison table below, they both basically return the same...Continue reading

How to attach database without transaction log

How to attach database without transaction log files in SQL Server Instance

If you are trying to attach a database and you only have the database file (.mdf) and not the transaction log file (.ldf) the steps are fairly similar to what they were in my previous blog – How to attach database using different methods in SQL Server Instance. Just like when attaching a database with transaction log...Continue reading

attaching and detaching a mysql or SQL server database

How to attach database using different methods in SQL Server Instance

Today I needed to transfer one of our development databases to another development environment. I had two choices: I could make a full backup/restore and drop the database since we did not want the same database stay on both servers or I could use the detach/attach database method. In order to eliminate some steps I decided to...Continue reading

Scroll to top