Rename logical & physical MSSQL files

This post will provide guidance on how to amend the logical and physical file names of a MSSQL database.When a copy of a database is restored as a new database, the logical file names will remain the same as the source database.Firstly, check the current logical and physical file names: USE master GO SELECT name AS [Logical_name], physical_name AS [File_Path], […]

Change the logical name of MSSQL database/transaction log files

When a database backup is restored in MSSQL, the physical filenames can be amended during the restore process but the logical names for the source database and transaction log files are kept. It is a simple step to amend these however… First, find the current names of the files where <database_name> is the name of the restored DB. SELECT database_id, […]

How to identify the ports used by a Windows process

If you have several services running on your Windows server you may need to check which ports they are using in order to prevent or resolve any conflicts. The first step is to obtain a list of the ports being used, this can be carried out by opening a Command Prompt and executing netstat.exe and the following switches: -a list all […]

Installing the Adventure Works 2012 sample database

After installing SQL Server 2012, it is a good idea to download and add the sample database to your SQL Server instance. To get the datafile, browse to the Microsoft SQL Server Samples page on CodePlex and take the AdventureWorks2012 Data File. Once the download has completed, it is advisable to copy the data file to your DATA folder, in my […]

Value cannot be null

After issues with my laptop not being able to find critical files this morning I managed to boot to the last know good configuration. This seemed to have got me past all the errors I previously had, however, I noticed that things weren’t quite right. When attempting to open SQL Server Management Studio (SSMS) 2012 I received the error “Value […]

SQL Server Central Management Server (CMS) Intro

Introduction Central Management Server (CMS) was first introduced in SQL Server 2008, it enables simplified management of multiple MS SQL database servers and instances. My screenshots are taken from SQL Server 2012 but should be relevant in SQL 2008 and 2008 R2 as well. If you are managing more than a couple of SQL instances you’ll already be aware of […]