﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Development  / Custom Stored Procedures in MSDB / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 23:14:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Custom Stored Procedures in MSDB</title><link>http://www.sqlservercentral.com/Forums/Topic445019-145-1.aspx</link><description>sometimes it is valid to put custom SPs in master or msdb.suppose you want an sp to be globally accessible? put it in master, prefix it sp_ all set. yes u need to take this into account in DR scenario, but this is not a big deal. SPs to do Backups, Greps, or send SMTP mail are good candidates for the master database. Also, can mark the object as system as well.How about an SP to return job execution status and history? There is nothing wrong with putting that in msdb.i do agree that i will avoid restoring master if possible -- often rather just restore user DBs and msdb to a new instance, so keeping the scripts available is important. and yes, having your own administrative db should be a must for DBAsPutting user objects of any type in system databases should not be done without careful consideration, but there are certainly valid scenarios in which doing so is a good idea.NOW -- the script for the trace the OP is asking for...if it's too big for a job, my recommendation is to put it in a file and execute with SQLCMD.</description><pubDate>Tue, 22 Jan 2008 10:20:20 GMT</pubDate><dc:creator>russell-154600</dc:creator></item><item><title>RE: Custom Stored Procedures in MSDB</title><link>http://www.sqlservercentral.com/Forums/Topic445019-145-1.aspx</link><description>Why put it in either one? It will cause you issues during recovery (DR) if you need it. I've often seen people forget that these procedures are there, they recover the user database s and they're stuck. Or you might not want to restore master (or msdb).Any reason not to make your own small administrative database and stick it in there?</description><pubDate>Tue, 22 Jan 2008 08:59:52 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: Custom Stored Procedures in MSDB</title><link>http://www.sqlservercentral.com/Forums/Topic445019-145-1.aspx</link><description>Why Msdb ?!Master is not confortable for you?If you won't create any kind of Database support, but you want to use a SP, then this sp can be stored on the master sp site, isn't it ?</description><pubDate>Tue, 22 Jan 2008 08:25:52 GMT</pubDate><dc:creator>RobertoRai</dc:creator></item><item><title>RE: Custom Stored Procedures in MSDB</title><link>http://www.sqlservercentral.com/Forums/Topic445019-145-1.aspx</link><description>If there's a reason to store something in the system DB's - I'd put it in master (it's a reasonably common practice).  Is there a specific reason you want to put it in MSDB?  Like Vyas pointed out - MSDB is one of the files where all sorts of processing occurs, and I wouldn't modify it at all unless there's a darn good reason to do so.</description><pubDate>Tue, 22 Jan 2008 08:19:00 GMT</pubDate><dc:creator>Matt Miller (#4)</dc:creator></item><item><title>RE: Custom Stored Procedures in MSDB</title><link>http://www.sqlservercentral.com/Forums/Topic445019-145-1.aspx</link><description>The MSDB database is one of the heaviest-used system databases. It stores everything from DTS packages to Jobs (and the history of each). You can create but it will slow down the performance.</description><pubDate>Tue, 22 Jan 2008 05:04:34 GMT</pubDate><dc:creator>vyas</dc:creator></item><item><title>Custom Stored Procedures in MSDB</title><link>http://www.sqlservercentral.com/Forums/Topic445019-145-1.aspx</link><description>This may seem like a stupid question and I am pretty sure I already know the answer but I wanted to do a gut check and was unable to find the answer anywhere else.Is it OK to create custom stored procedures in the MSDB system database?  I would think it would be fine but I really don't want to break anything and then have to explain to my boss what I broke and how I broke it.  I need to create a stored procedure to run a server side trace.  I can't fit all the script into a job, and I really don't want to put it in any other databases, not create a db only to house a sp or two.</description><pubDate>Fri, 18 Jan 2008 10:36:18 GMT</pubDate><dc:creator>nick harris-294131</dc:creator></item></channel></rss>