Category: MSSQL
-
Quickly install the SQL powershell toolls on your local machine
I wanted to quickly install the 2012 powershell tools on to my machine. I could’t find a simple summary, so here goes: Visit this site: http://www.microsoft.com/en-us/download/details.aspx?id=29065 Download the following: Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server® 2012 Microsoft® SQL Server® 2012 Shared Management Objects Microsoft® System CLR Types for Microsoft® SQL Server® 2012 Wherever…
-
SQL query to find number of WordPress posts per week
I wanted to know how many posts I have been creating each week. Here is a quick MySQL query to find out: Returns:
-
PowerShell code to query a table, and put the XML results into a SharePoint Document Library
If you look at this prior post, I showed how you can use an xml file in a document library as a source for an input box’s jQuery autocomplete. I wanted to automate the creation of these XML files and upload them to a SharePoint Document Library. For example, I wanted to query Microsoft CRM…
-
My PowerShell command to backup SQL server
Below is my PowerShell code to backup SQL servers. This will create a folder in the destination with the ServerName, then a subfolder with the date, and then a subfolder with the hour. You can backup a single database or all of them. You must have the PowerShell SQL snap ins installed: Add-PSSnapin -name SqlServerProviderSnapin110…
-
How we recovered from a Microsoft SQL 2005 suspect msdb database
I am not a MS SQL Server guru. Honestly, it is a “set it and forget it” technology for me. After our last patching episode, we ended up with a SQL Server Agent offline, and our msdb file was listed as suspect. Seems like there are 2 ways to recover from this. 1 restore a…
