January 23, 2013 by Kenneth Fisher

I just wanted to do a brief highlight of a handy little object property. For those of you who aren’t aware there are a handful of “property” functions available that can give you all sorts of information about your object, database etc. For example DATABASEPROPERTY, DATABASEPROPERTYEX, OBJECTPROPERTY, OBJECTPROPERTYEX, FILEPROPERTY etc.

In this particular case I’m looking at one of the properties available using OBJECTPROPERTY. IsMSShipped returns a 1 if the object was created during the installation of SQL Server.

So if you run the following code you will get back a list of all of the “user” objects in the AdventureWorks2008 database.

 USE AdventureWorks2008

SELECT * FROM sys.objects
WHERE objectproperty(object_id,'IsMSShipped') = 0

And of course the reverse is true.

 USE AdventureWorks2008

SELECT * FROM sys.objects
WHERE objectproperty(object_id,'IsMSShipped') = 1

This code returns all of the objects that were orriginally shipped with SQL Server.

I will agree that this isn’t the most useful property in the world for most people, but it does come in handy if you are the type of person (like me) who ends up querying the system object tables on a fairly regular basis.

3 thoughts on “IsMSShipped

  1. sqlpathy says:

    Good one. Though I have been using Object Property function for some time now. But i was not aware of this property. Thanks for sharing.

  2. Anupam says:

    Good.. this what I was looking for

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 3,755 other subscribers

Follow me on Twitter

ToadWorld Pro of the Month November 2013
%d bloggers like this: