Objects and Filegroups

  • By joining sys.filegroups and sys.indexes on data_space_id, I can find the specific filegroup in which a given heap or clustered index exists. Is there a way to tell which filegroup contains a given view or stored procedure, or do that always exist in PRIMARY?

    Thanks,

    Alex

  • Yes, you can extend the your query with sys.objects, sys.tables, sys.procedures and etc...

    Just explore a bit.

    Igor Micev,My blog: www.igormicev.com

  • Views and stored procs are stored within the system tables (they're just saved code), system tables are always on primary. While you can join from sys.indexes to sys.objects it will never match procedures and for views will only match indexed views.

    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
  • Igor, Gail,

    Thank you both so much.

Viewing 4 posts - 1 through 3 (of 3 total)

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