Browse by Tags

Tagged Content List
  • Blog Post: Auditing SQL Agent job creation and deletion

    SQL Agent jobs are added / removed using stored procedure interface sp_add_job and sp_delete_job. Customers have asked us how we could track user who has created a job / deleted a specific job. You could accomplish this using SQL Server Auditing feature. You can turn on Auditing to track and log stored...
  • Blog Post: Starting Jobs in Powershell using Job Name

    http://blogs.msdn.com/b/sqlagent/archive/2010/12/29/starting-jobs-in-powershell-using-job-name.aspx This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
  • Blog Post: Scheduled Policy Evaluation on multiple servers using MSX/ TSX in SQL Agent

    One of our customer was looking for ways to schedule a policy evaluation on multiple servers using their existing MSX/TSX infrastructure. I thought it would be better to blog an article that could help others looking for similar information http://blogs.msdn.com/b/sqlagent/archive/2010/11/19/scheduled...
  • Blog Post: Create a database backup job using SQL Server Management Studio

    SQL Server Management Studio can be used to create a database backup job to backup an user database. Link This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
  • Blog Post: Create SQL Agent job using SMO

    # Powershell script to create a new Agent job and list the job using JobCollection # Inspects error collection and prints all inner exception function CheckForErrors { $errorsReported = $False if ( $Error . Count - ne 0 ) { write-host "******************************" write-host "Errors:" , $Error . Count...
  • Blog Post: Change Service Account Password for Sql Server / SQL Agent Accounts

    changeSvcAcct.ps1 ########################################################################################### # Scenario:Change Service account for SQL Server, Agent services # # How to use this powershell script: # - Launch SQL Server PowerShell ( Start -> Run -> sqlps.exe) # - Copy the following...
  • Blog Post: Troubleshooting Arithmetic overflow errors in queries using Extended Events in SQL Server 2008

    Problem: Management view sys.dm_exec_requests has a column total_elapsed_time to track the total time elapsed in milliseconds since the request arrived. Following T-SQL query converted this value from milli-seconds to micro-seconds. -- Simplified version of a complex T-SQL batch SELECT session_id...
  • Blog Post: Configure Database Mirroring using SQL 2008 Power Shell

    ########################################################################################### # Scenario: Configure Database mirroring # # How to use this powershell script: # - Launch SQL Server PowerShell ( Start -> Run -> sqlps.exe) # - Copy the following powershell script and save to file (Ex...
  • Blog Post: SQL 2008 powershell script to print Resource Governor properties

    ########################################################################################### # SQL 2008 powershell script to print Resource Governor state, properties, Resource pools and corresponding workload groups # # How to use this powershell script: # - Launch SQL Server Management Studio ( Start...
  • Blog Post: SQL 2008 Powershell Script for creating a Policy and saving to file

    ########################################################### # SQL 2008 Powershell Script for Policy Based Management # Scenario: Create a server policy to check if XPCmdShell is disabled and save it to file # # To run this Powershell script # 1) Install SQL Server 2008 # 2) Run SQL PowerShell ( Start...
  • Blog Post: SQL Powershell - Unrestrict Growth size on all Database Files that has AutoGrowth set as None

    ########################################################################################### # Scenario: Unrestrict Growth size on all Database Files that has AutoGrowth set as None # The following SQL 2008 Powershell sample code enumerates all user database data files and sets Autogrowth by 10% # # How...
  • Blog Post: SQL 2008 Power Shell script - Databases that were not backed up in last 7 days

    a) Install SQL Server 2008. b) Launch SQL Server Management Studio ( Start -> All Programs -> Microsoft SQL Server 2008 -> SQL Server Management Studio) c) Connect to SQL Server instance, Right click on the server node in Object Explorer and click on "Start Power Shell" menu d) Get...
Page 1 of 1 (12 items)