Master Database

  • Hi,

    I found that some developers created user created tables in master database recently. Can we create user created tables in master database. Incase yes, in what situations we need to create tables in master database. As far as i know we should not create tables in master database.

    This is the script i used to find tables in master database.

    SELECT * FROM sys.tables

    GO

  • You can create anything you like in master, you probably shouldn't in most cases, but you can.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You can use the object property isMSShipped to help you find user created objects.

    SELECT *

    FROM sys.objects

    WHERE objectproperty(object_id, 'ismsshipped')=0

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • Thank you. I got the point.

  • Kenneth.Fisher (4/19/2013)


    You can use the object property isMSShipped to help you find user created objects.

    SELECT *

    FROM sys.objects

    WHERE objectproperty(object_id, 'ismsshipped')=0

    good one Kenneth..

    I was not aware of property 'ismsshipped'

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • You could also use

    SELECT *

    FROM sys.objects

    WHERE is_ms_shipped<>1

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply