Undocumented SQL Server 2012 Database Mail Procedures SQL Server 2012 supports the following useful undocumented database mail stored procedures: sp_RunMailQuery sp_SendMailMessage sp_sysmail_activate sysmail_verify_account_sp sysmail_verify_principal_sp sysmail_verify_profile_sp sp_RunMailQuery The sp_RunMailQuery database mail stored procedure is used to run the mail query. This stored procedure is used in the sp_send_dbmail stored procedure to execute a query if query is specified. Syntax sp_RunMailQuery [...
Author: Alexander Chigrik
Undocumented SQL Server 2012 Database Maintenance Plan Stored Procedures
Undocumented SQL Server 2012 Database Maintenance Plan Stored Procedures SQL Server 2012 supports the following useful undocumented database maintenance plan stored procedures: sp_clear_dbmaintplan_by_db sp_maintplan_close_logentry sp_maintplan_delete_log sp_maintplan_delete_plan sp_maintplan_delete_subplan sp_maintplan_open_logentry sp_maintplan_start sp_clear_dbmaintplan_by_db The sp_clear_dbmaintplan_by_db database maintenance plan stored procedure is used to delete the maintenance plans, the maintenance plan’s history and the maintenance plan’s jobs for the specified database. Syntax sp_clear_dbmaintplan_by_db [...
Undocumented SQL Server 2012 distributed queries stored procedures
Undocumented SQL Server 2012 distributed queries stored procedures SQL Server 2012 supports the following useful undocumented distributed queries stored procedures: sp_catalogs_rowset sp_catalogs_rowset_rmt sp_catalogs_rowset2 sp_linkedservers_rowset sp_linkedservers_rowset2 sp_catalogs_rowset The sp_catalogs_rowset distributed queries stored procedure returns the database name for the specified database if the current user has access for this database. Syntax sp_catalogs_rowset [ @catalog_name = ] ‘catalog_name’ Arguments [ @catalog_name =...
Undocumented SQL Server 2012 log shipping stored procedures
Undocumented SQL Server 2012 log shipping stored procedures In this article, I want to describe the following six undocumented log shipping stored procedures shipped with SQL Server 2012: sp_add_log_shipping_monitor_jobs sp_check_log_shipping_monitor_alert sp_create_log_shipping_monitor_account sp_delete_log_shipping_monitor_info sp_delete_log_shipping_monitor_jobs sp_log_shipping_get_date_from_file sp_add_log_shipping_monitor_jobs The sp_add_log_shipping_monitor_jobs log shipping stored procedure is used to add ‘Log Shipping Alert Job – Backup’ and ‘Log Shipping Alert Job – Restore’ jobs. Syntax...
Undocumented SQL Server 2012 Database Engine Stored Procedures
Undocumented SQL Server 2012 Database Engine Stored Procedures SQL Server 2012 supports the following useful undocumented database engine stored procedures: sp_bcp_dbcmptlevel sp_MSforeachdb sp_MSforeachtable sp_MSindexspace sp_MStablespace sp_objectfilegroup sp_oledb_defdb sp_oledb_deflang sp_oledb_language sp_who2 sp_bcp_dbcmptlevel The sp_bcp_dbcmptlevel database engine stored procedure is used to get the database compatibility level for the specified database. Syntax sp_bcp_dbcmptlevel [ @dbname = ] ‘dbname’ Arguments [ @dbname =...
Undocumented SQL Server 2012 Security Stored Procedures
Undocumented SQL Server 2012 Security Stored Procedures SQL Server 2012 supports the following six undocumented security system stored procedures: sp_MSdbuseraccess sp_MSdbuserpriv sp_MSchangeobjectowner sp_MSGetServerProperties sp_MSloginmappings sp_MSSetServerProperties sp_MSdbuseraccess The sp_MSdbuseraccess system stored procedure is used to check what kind of access the current user has in the specified database or in all databases. Syntax sp_MSdbuseraccess [ @mode = ] ‘mode’, [ @qual...
Undocumented SQL Server 2012 XML Stored Procedures
Undocumented SQL Server 2012 XML Stored Procedures SQL Server 2012 supports the following three undocumented XML system stored procedures: – sp_syscollector_validate_xml – sp_xml_schema_rowset – sp_xml_schema_rowset2 sp_syscollector_validate_xml The sp_syscollector_validate_xml system stored procedure is used to validate the XML collector. Syntax sp_syscollector_validate_xml [ @collector_type_uid = ] ‘collector_type_uid’, [ @name = ] ‘name’, [ @parameters = ] ‘parameters’ Arguments [ @collector_type_uid = ]...
Useful undocumented SQL Server 2012 Agent Procedures
Useful undocumented SQL Server 2012 Agent Procedures SQL Server 2012 supports the following useful undocumented SQL Server Agent stored procedures: sp_MSgetalertinfo sp_readerrorlog sp_MSget_jobstate sp_delete_all_msx_jobs sp_get_job_alerts sp_multi_server_job_summary sp_help_operator_jobs sp_sqlagent_is_srvrolemember sp_sqlagent_get_startup_info Three of these stored procedures exist in the master database (sp_MSgetalertinfo, sp_readerrorlog and sp_MSget_jobstate), other exist in the msdb database. sp_MSgetalertinfo The sp_MSgetalertinfo stored procedure is used to get information about...
Troubleshooting SQL Server 2012 CLR Problems
Troubleshooting SQL Server 2012 CLR Problems If you have problems with SQL Server 2012 Common Language Runtime (CLR) objects, review this troubleshooting checklist to find potential solutions. 1. Install the latest SQL Server 2012 service pack. Because some SQL Server 2012 CLR bugs were fixed in SQL Server service packs, you should install the latest SQL Server service pack. At...
Undocumented SQL Server 2012 extended stored procedures (Part 2)
Undocumented SQL Server 2012 extended stored procedures (Part 2) An extended stored procedure (xp) is a dynamic link library that runs directly in the address space of SQL Server. You can run extended stored procedures as normal stored procedures. Extended stored procedures are used to extend the capabilities of SQL Server. You can take advantage of the many extended stored...