x
login about faq Site discussion (meta-askssc)

Master Database

Can we create objects(tables, SPs, triggers, etc...) in the master database. If yes, in which cases can they be required and are helpful??

more ▼

asked May 04 '12 at 04:58 AM in Default

mituljain9 gravatar image

mituljain9
30 2 4 6

If I am not mistaken, I believe that now the system objects are not stored in the master db but in the resource db. So does creating these objects in master make enough relevence?? Also, has anyone tried creating tables in the master db?? If yes, in what senario you came accross that requirement?? If not, can they be created and when can they be useful??

May 04 '12 at 06:05 AM mituljain9
(comments are locked)
10|1200 characters needed characters left

2 answers: sort oldest

Yes, you can create objects in the master database, but you should not create unnecesary users objects in it.

It has sense to create some custom stoerd procedures, views in the master database which are used for management and administration of the server.

It is usefull for example for stored procs like sp_who2, sp_find, sp_CloneRights, which can be custom stored procedures marked as system procedures.

In that case even they reside in master database, then are available for all databses and in case of proceures marked as system, they will operate in the context of current database.

more ▼

answered May 04 '12 at 05:14 AM

Pavel Pawlowski gravatar image

Pavel Pawlowski
20.3k 5 10 20

(comments are locked)
10|1200 characters needed characters left

Master is like any other database, you can create tables, views etc, but Master is a system database, not a user database.

Except for some instance wide procedures (which Pavel mentioned), don't treat this database as a user database. It's true that some system information is stored in the resource database, but that doesn't mean the master database should be available for user applications.

more ▼

answered May 04 '12 at 09:28 AM

Wilfred van Dijk gravatar image

Wilfred van Dijk
549 13 18 20

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x10

asked: May 04 '12 at 04:58 AM

Seen: 342 times

Last Updated: May 04 '12 at 09:54 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.