April 19, 2013 at 8:06 am
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
April 19, 2013 at 8:22 am
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
April 19, 2013 at 8:44 am
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]
April 20, 2013 at 12:58 am
Thank you. I got the point.
April 20, 2013 at 1:05 am
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/
April 20, 2013 at 8:05 am
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