Monthly Archives: January 2013

Complete SSMS is available for free in SQL 2012 SP1

In SQL 2012 SP1, Full SSMS is available as a free download. You can download SSMS (SQL 2012 SP1) from     Advertisements

Posted in Uncategorized

Backup all databases using Backup-SqlDatabase cmdlet

Launch SSMS Right click on databases node, Select Menu item “Start PowerShell” Type in following command to backup all databases to Default backup folder dir |  Backup-SqlDatabase     Databases are backed up to Default backup folder  

Posted in Backup, Scripting, SQL Power shell, SQL Server

DMV – Windows Operating System version information

You can use the DMV on SQL 2008 R2 and above to query Windows OS information SELECT * FROM sys.dm_os_windows_info References: MSDN: Related Forum thread:

Posted in DMV, SQL Server

Set autoclose property for all database

in SSMS , Right click on database node in Object Explorer, Select menu item “Start PowerShell” Type in following in power shell window to set Auto Close on all databases dir | foreach {$_.AutoClose = $true; $_.Alter()} If you would

Posted in DB Management, SQL Power shell, SQL Server, SSMS

Multi-server results options to merge results

You could set the Multi Server results Options Merge Results = “False” and rerun the same query. Now you will see multiple result sets. This could help you isolate the issue why the result schema returned by specific server is

Posted in Uncategorized

Capturing session level options settings on all sessions in SQL 2012 using XEvents

You could use XEvents to capture options set at all existing sessions & any future new sessions. Here is sample session definition. (I have tested it on SQL 2012 SP1). Please replace the file path in the following script to

Posted in SQL Server, XEvents

Scripting database using Smo.Scripter

You can automate script generation using SMO and power shell using the following power shell script. Script generated would be similar to the script generated using “Generate Script Wizard” in ssms You can download script from here This posting is

Tagged with:
Posted in Scripting, SQL Power shell, SQL Server