Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jpham
Starting Member
19 Posts |
Posted - 2006-09-15 : 20:00:44
|
Hi All.Is there a easy way to get the file group of the primary key of the table.I have a table called TABLEA for example and there is the primary key PK_TABLEA is created in the MSSQL database and I want to find out what the file groupthis primary key PK_TABLEA is created on.Your help is greatly appreciated.Thanks,JP |
|
Luis Martin
Yak Posting Veteran
54 Posts |
Posted - 2006-09-15 : 20:23:15
|
If I understand your question:You can use QA or EM for that. With QA, Tools, Manage Index, your database, pick Pk, edit and you will find filegroup. |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-17 : 02:16:18
|
You can also use undocumented sp_objectfilegroup procedure like this:Declare @obj intselect @obj = Object_ID('TableA')exec sp_objectfilegroup @obj Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-17 : 02:22:05
|
or this:select g.groupnamefrom sysindexes ijoinsysfilegroups g on i.groupid = g.groupid where i.name = 'PK_TableA' Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
|
|