Handy DB Scripts – Rename w/Powershell

Powershell has become a nice toolbox addition to a must-have for, say, Azure. Here’s a slick way to rename files either one or in bulk. Lee Open Powershell #1: Windows Powershell ISE l Open Powershell #2: command prompt Command: Get-ChildItem -Filter "*string to replace*" -Recurse | Rename-Item -NewName {$_.name -replace 'string to replace','new str' } … Continue reading Handy DB Scripts – Rename w/Powershell

Cannot connect to ‘servername’

Cannot connect to servernameAdditional Information: Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was – [Pre-Login] initialization=14655; handshake = 13502;  … Continue reading Cannot connect to ‘servername’

Handy DB Scripts – Fix Orphaned SQL Logins

Another script that’s nice to have around is a fix orphaned login script. I use this in particular when restoring databases from one server to another, and you simply receive a login fails error. Today, SSRS was trying to use an orphaned login and got: · An error has occurred during report processing. (rsProcessingAborted) · … Continue reading Handy DB Scripts – Fix Orphaned SQL Logins

Handy DB Scripts – Last Database Restore Date

I need to start collecting scripts someday…I’ve been saying that forever, but haven’t started yet. Maybe it’s time now, and this script is a good one to keep around. This one is to find the last database restore date, and it looks something like: WITH LastRestore AS ( SELECT      [name] AS DatabaseName     ,[create_date] … Continue reading Handy DB Scripts – Last Database Restore Date

Ode to Sunil – Minimal Logging changes in SQL Server 2008

Exploring blog posts from the Database Engine Team Refer to Sunil Agarwal’s series on minimal logging in SQL server… their blog site. What is minimal logging? Minimally logged operations, sometimes incorrectly referred to as ‘non-logged’, is the method that can be used to speed up data manipulation (DML) or Bulk Loading by using techniques to … Continue reading Ode to Sunil – Minimal Logging changes in SQL Server 2008

Learning SQL Server

Getting Started with SQL Server SQL Server is a relational database management system, a ‘back-end’ for storing data. Data for an application needs to be stored somewhere, and SQL Server is a good place to store it. One example that I always share with students (and mostly relatives, when they ask ‘just exactly what do … Continue reading Learning SQL Server