March 9, 2005 at 5:45 am
Is there a single command that I could execute in T-SQL that would list all tables and the file they "lived" in for a given database? If not, what would you recommend to produce such an output?
Thanks for the help...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 9, 2005 at 6:43 am
Is this what you're looking for ?
this query uses native sqlserver systemtables .
SELECT FG.groupid AS GroupID
, SUBSTRING(FG.groupname,1,30) AS FilegroupName
, SUBSTRING(O.name,1,30) AS ObjectName
, ix.indid, ix.name as indexname
, F.filename as FileNames
FROM sysobjects O
INNER JOIN sysindexes IX
ON O.id = IX.id
INNER JOIN sysfilegroups FG
ON IX.groupid = FG.groupid
INNER JOIN sysfiles F
on F.groupid = FG.groupid
WHERE O.xtype = 'U'
ORDER BY FG.groupname, O.ObjectName
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
March 9, 2005 at 6:48 am
Very nice alzdba! It's exactly what I needed. Thanks for coming through on such short notice... I was really in a crunch and you've just made it possible for me to complete under the wire.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 9, 2005 at 6:52 am
Keep in mind filegroup-files are balanced within a group, so your maxcapacity is the size of the smallest file * the number of files in the filegroup.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply