Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 12th, 2004, 08:06 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Yugoslavia.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tables and File Groups

Hi everybody
I need query that will determine which tables are created on primary file group or secondary file group...
I know that i can exectute sp_help 'tablename' to see on which file group the only one table is.
But i have 2000 tables and it is very slow to execute sp_help for every table.
alex
Reply With Quote
  #2 (permalink)  
Old March 12th, 2004, 08:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

There's probably a nicer way to do it, but this seems to work:

SELECT DISTINCT sysobjects.name, sysfilegroups.groupname
FROM sysobjects
INNER JOIN sysindexes ON sysobjects.id = sysindexes.id
INNER JOIN sysfilegroups ON sysindexes.groupid = sysfilegroups.groupid
WHERE (sysobjects.xtype = 'U')
Reply With Quote
  #3 (permalink)  
Old March 12th, 2004, 09:38 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Yugoslavia.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks
alex
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import a XML file into SQL Server tables Cha BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 April 1st, 2008 09:54 PM
Query to extract data from 2 tables of .mdb file Subuana Beginning VB 6 6 March 16th, 2006 04:37 PM
Groups Ma7T XSLT 1 August 25th, 2005 12:01 PM
Linked Tables using file DSN Axra Access VBA 2 February 16th, 2005 02:05 PM
Groups help in 8.5 for VS.net risu Crystal Reports 0 March 15th, 2004 04:27 PM



All times are GMT -4. The time now is 02:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.