Gathering list of databases names from multiple SQL Servers

# serverList.txt has name of fully qualified sql instance ( one per line) # Example entries: # server1 # server1\instance1   $instanceNameList = Get-Content C:\ServerList.txt   foreach($instanceName in $instanceNameList) { $results += Invoke-Sqlcmd -Query “select SERVERPROPERTY(‘ServerName’) As ServerName, Name, crdate from sysdatabases” -ServerInstance $instanceName.Name }   # print results $results   # This posting is…

0

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 procedure execution requests…

0