SQL Server: Run A Very Large Script By Splitting It Into Pieces Using PowerShell

Everyday is an interesting day in the life of a DBA. Today, I received a request to run in a HUGE script. This script had 125k INSERT statements each in a separate line. Just opening the script was an issue, leave alone running it into a database. You get this error in SSMS just trying … Continue reading SQL Server: Run A Very Large Script By Splitting It Into Pieces Using PowerShell

Advertisements

Clone A SQL Server Software Installation

Cloning is perhaps not the right term to use here but let us pretend that it is and keep going. Let us say that you want to install SQL Server on another host say NewHost but you want it to have the same settings as another host/instance on say ModelHost. In fact, let us say … Continue reading Clone A SQL Server Software Installation

PowerShell: Save Millions By Downgrading Your SQL Server Edition & Partially Automate It!

This is one of those fresh ideas I wish I had but in reality it did not occur to me until it came down to me for execution from above me. Good job managers! Kudos. Sorry, I did not come-up with this! Execution: "I can do really well and you have got the best". I … Continue reading PowerShell: Save Millions By Downgrading Your SQL Server Edition & Partially Automate It!

SQL Server – Simple Tip On Altering SQL Server Tables With Data – Avoid “Saving changes not permitted”

This is a very simple yet handy tip that most SQL Server users are not aware of. Can't alter tables with data?! If you use SQL Server, you must have seen this dialog when you try to alter a table in SSMS (like adding a new column to an existing table containing data). What does … Continue reading SQL Server – Simple Tip On Altering SQL Server Tables With Data – Avoid “Saving changes not permitted”

SQL Server: SSMS Says “Lock request time out period exceeded.” – Identify Blocking Source Quickly

Time-tested approach Although I explain the process for table expansion, the troubleshooting steps to find any blocking session is to run sp_who2 and look at the BlkBy column to get the session id that is blocking a┬ásession (assuming you can identify sessions from the information in the other columns) and examine the blocking session. Then … Continue reading SQL Server: SSMS Says “Lock request time out period exceeded.” – Identify Blocking Source Quickly