Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Determining which tables are in which file group via T-SQL

 
   Database Help (Home) -> MSEQ RSS
Next:  comprar sildenafil generico donde comprar cialis ..  
Author Message
Michael B.

External


Since: Aug 15, 2008
Posts: 1



(Msg. 1) Posted: Fri Aug 15, 2008 9:35 am
Post subject: Determining which tables are in which file group via T-SQL
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

I'm trying to figure out how to list what file group every table is in. I
thought this query was it :

select sys.tables.name,sys.data_spaces.name from sys.tables,sys.data_spaces
where sys.tables.lob_data_space_id = sys.data_spaces.data_space_id order by
sys.tables.name

Until I realised that it only tells me where the LOB objects are. I've been
beating my head against a wall on this, any guidance?

M.

 >> Stay informed about: Determining which tables are in which file group via T-SQL 
Back to top
Login to vote
Tariq

External


Since: Aug 27, 2008
Posts: 3



(Msg. 2) Posted: Wed Aug 27, 2008 7:39 am
Post subject: RE: Determining which tables are in which file group via T-SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

try below query,

SELECT OBJECT_NAME(SI.OBJECT_ID) AS OBJECTNAME
,SI.DATA_SPACE_ID AS FILE_GROUP_ID
,SFG.NAME AS FILE_GROUP_NAME
,SF.NAME AS LOGICAL_FILE_NAME
,SF.FILENAME AS PHYSICAL_FILE_NAME
FROM SYS.INDEXES SI
INNER JOIN SYS.FILEGROUPS SFG ON SFG.DATA_SPACE_ID=SI.DATA_SPACE_ID
INNER JOIN SYS.SYSFILES SF ON SF.GROUPID = SFG.DATA_SPACE_ID
WHERE SI.INDEX_ID IN (0,1)

for further queries about file group,
http://sqlserver4me.blogspot.com/2008/08/how-to-view-association-among-file.html

 >> Stay informed about: Determining which tables are in which file group via T-SQL 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
update querie multiple tables - Hi I wish to create a stored procedure that updates multiple tables. I have a table called User CREATE TABLE [dbo].[Users]( [UserId] [int] NULL, [Active] [bit] NULL, [OrganisationId] [int] NULL, [Username] [varchar](20), [Password] [varchar](20),....

Producing data from querying three tables - Hi all, I'm trying to run a query that produces data from three tables, in essence these are Location, Category and BannerPeriod, They all have a secondary key of SiteID and are linked by this, really there are two stages to this query, Stage 1..

Output file - I have an osql statement that queries a database. If the query returns any rows I want them written to a file, so I redirected the output of my osql statement to a file (results.txt). But if there are no rows that comply with the condition of the..

index on a view - Hello, I have a table (TAB) and A View with alias (VIEW) Table cod varchar 3 descr carchar 60 my view cod alias COd1 descr alias DES Now i need a index on view with key COD1 I can't create it. Can..

Creating an alias - I have an alias that can get very long because it maintains a information of where it came from. Is there a way to alias an alias? My first thought was: Declare @T1 varchar(128) Set T1 = 'MyAlias' .... Inner Join Table1 as @T1 This of course does no...
   Database Help (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]