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 http://www.microsoft.com/en-us/download/details.aspx?id=29062     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: http://msdn.microsoft.com/en-us/library/hh204565.aspx Related Forum thread: http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/9753f897-82e3-4602-b7c9-650c7239e83d

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