Category Archives: SQL

PowerSQL – Get SQL TraceFlag SQL Service and Config Information

Get SQL Server configuration, service info, start type along with enabled Trace Flags of local or remote servers. This script outputs sql server configuration, service, start type, Service Account along with startup trace flags. The script will work on SQL … Continue reading

Posted in PowerShell, SQL | Tagged , , | 2 Comments

SQL – MultiServer SQL Inventory – PowerShell

Inventory is a vital information,whether you’re a consultant or an in-house DBA, you need to have a reliable inventory of the servers you manage.This inventory can take any number of forms but, ideally, will allow some aggregation of information. When … Continue reading

Posted in PowerShell, SQL, Uncategorized | Tagged , , , , , | Leave a comment

PowerShell : Scripting Logins, Role Assignments and Server Permissions Using PowerShell

This post is a continuation of Multiple DB refresh automation using PowerShell post . The OP requested me to automate the login transfer process as well. The script should generate an outfile and execute the file on the target server. <# .ProblemStatement Copying … Continue reading

Posted in PowerShell, SQL | Tagged , , | 6 Comments

PowerShell – SQL Database Refresh -Restore – Multiple Databases

.SYNOPSIS The purpose of the script is to restore database/s from a database backup. The requirement is to refresh ‘n’ databases. .DESCRIPTION The advantage is that the flexibility of passing restoreDbList to restore specific group of databases. The Restore databases has … Continue reading

Posted in PowerShell, SQL | Tagged , , | 7 Comments

PowerShell – Backup Specific group of SQL Databases

<# .SYNOPSIS The purpose of the script is to initiate backup only for desired group of databases. The requirement is to refresh databases. .DESCRIPTION The advantage is that the flexibility of passing a list of specific group of databases for … Continue reading

Posted in PowerShell, SQL | Tagged , , , | 2 Comments

SQL Server : Could not load file or assembly ‘Microsoft.SqlServer.BatchParser, Version=10.0.0.0

I have recently encountered an issue with a third-party  backup application (Commvault) . I was trying to backup the databases on SQL 2014. It was throwing a below error “Description: Error encountered during backup. Error: [ Could not load file … Continue reading

Posted in SQL | Tagged | 3 Comments

PowerShell – SQL Databases Backup Status Report of Multiple Servers

  This post is a requirement from one of my blog reader. There are plenty of scripts available to get the backup status of the databases across multiple server. The  requirement is to read a server name and application names … Continue reading

Posted in Backup and Restore, PowerShell, SQL | Tagged , | 13 Comments

SQL DB Details Of Multiple Servers Using PowerShell

  One of my blog reader requested me to get the DB details(Server,DBName,Size,SpaceAvailable,LogSize,PercentUsed Log Space,compatiblilty mode, recovery model etc:-) using PowerShell hence this post is written. The power of PowerShell is to capture an output of DBCC commands and store … Continue reading

Posted in PowerShell, SQL | Tagged , | 4 Comments

Simple Methods to Recover master.mdf File Password

Overview MS SQL Server is the relational database management system used to store information in form of tables, views, indexes, triggers, constraints and stored procedures. Master Database File (MDF) is the main database file with the file extension .mdf used … Continue reading

Posted in Security, SQL, T-SQL | 1 Comment

Different ways to find Data, log and DB Size

Different ways to get the size of the data , log files and Databases Using Counters Querying sysaltfiles & sys.databases Querying sys.master_files   SELECT instance_name AS DatabaseName, [Data File(s) Size (KB)]/1024.00 [DataInMB], [LOG File(s) Size (KB)]/1024.00 [LogInMB], [Data File(s) Size (KB)]/1024.00 … Continue reading

Posted in SQL, sysfiles | Tagged , , | 4 Comments