views:

31

answers:

0

Back in SQL Server 2000, you could create your own custom information_schema views using an undocumented stored procedure called sp_ms_upd_sysobj_category. The trick seems to have been introduced to the world by Ken Henderson in his book, The Guru's guide to SQL server stored procedures, XML, and HTML. I used it to create two handy views that are notably missing from the default information_schema - namely INFORAMTION_SCHEMA.X_INDEXES and INFORAMTION_SCHEMA.X_INDEX_COLUMN_USAGE. It was also handy to create an extension of the columns view as well to include the notably missing fields like is_computed and is_identity. This was a really helpful way of implementing the poor-man's schema compare.

The trouble is, in SQL Server 2008 (and likely 2005 too), the sp_ms_upd_sysobj_category went away. When I try to create my extended views, I get the error:

The specified schema name "INFORMATION_SCHEMA" either does not exist or you do not have permission to use it.

While I realize that some purists may disagree with messing with these system views, this method offered a huge advantage in discover-ability for other developers, access from anywhere because they reside in master, and good encapsulation of sysobjects/systables to curb any developer temptation to tie their queries to something that may change out from under them over time.

Does anyone know the new method in SQL 2008 to create your own user-defined information_schema views, or a viable alternative that holds all the same benefits of creating your own?

related questions