Hello,
I have to filegroups like
database_data1 stored on d:
database_data2 stored on e:
How can I delete the database_data2 and tell SQL 2005 to copy all
data to database_data1?
Thanks for any help in advance!
A. KlemtOne way...
Assuming you have clustered indexes on all you tables is to drop and
recreate the index on the database_data1 filegroup this will also move
all the data over to database_data1
http://sqlservercode.blogspot.com/|||Hi
It is pretty much described in the BOL under "Moving database file"
"Andreas Klemt" <aklemt68@.hotmail.com> wrote in message
news:Oxkia5$JGHA.3200@.tk2msftngp13.phx.gbl...
> Hello,
> I have to filegroups like
> database_data1 stored on d:
> database_data2 stored on e:
> How can I delete the database_data2 and tell SQL 2005 to copy all
> data to database_data1?
> Thanks for any help in advance!
> A. Klemt
>
Showing posts with label filegroups. Show all posts
Showing posts with label filegroups. Show all posts
Friday, March 30, 2012
Monday, March 12, 2012
How to list all filegroups for a specific database?
Hi, all here,
Would please any expert here give me any guidance for how to list all filegroups for a specific database within SQL Server 2005?
Thanks a lot in advance for that.
With best regards,
Yours sincerely,
Within the database use the following command:
SELECT * FROM sys.filegroups
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
use northwind
select * from sysfiles
select * from sysfilegroups
|||Hi, Jens and Joeydj, thanks a lot for your guidance.
With best regards,
Yours sincerely,
Wednesday, March 7, 2012
how to know which filegroup a table is using with a SQL query
there are several filegroups
I want to know which filegroup a table is using with a SQL query
(i think there may be a SYSTEM TABLE I can query to know it)Benny
select
object_name(i.id) as table_name,
groupname as [filegroup]
from sysfilegroups s, sysindexes i
where i.id in (object_id('tablename'))
and i.indid < 2
and i.groupid = s.groupid
"Benny" <wuyuebing@.gmail.com> wrote in message
news:1178688427.945823.281780@.e65g2000hsc.googlegroups.com...
> there are several filegroups
> I want to know which filegroup a table is using with a SQL query
> (i think there may be a SYSTEM TABLE I can query to know it)
>|||On May 9, 1:54 pm, "Uri Dimant" <u...@.iscar.co.il> wrote:
> Benny
> select
> object_name(i.id) as table_name,
> groupname as [filegroup]
> from sysfilegroups s, sysindexes i
> where i.id in (object_id('tablename'))
> and i.indid < 2
> and i.groupid = s.groupid
> "Benny" <wuyueb...@.gmail.com> wrote in message
> news:1178688427.945823.281780@.e65g2000hsc.googlegroups.com...
> > there are several filegroups
> > I want to know whichfilegroupa table is using with a SQL query
> > (i think there may be a SYSTEM TABLE I can query to know it)
from your query, I found it is based on index's filegroup,
so how about if some table do not have index?
and how about .indid >= 2 ?
I want to know which filegroup a table is using with a SQL query
(i think there may be a SYSTEM TABLE I can query to know it)Benny
select
object_name(i.id) as table_name,
groupname as [filegroup]
from sysfilegroups s, sysindexes i
where i.id in (object_id('tablename'))
and i.indid < 2
and i.groupid = s.groupid
"Benny" <wuyuebing@.gmail.com> wrote in message
news:1178688427.945823.281780@.e65g2000hsc.googlegroups.com...
> there are several filegroups
> I want to know which filegroup a table is using with a SQL query
> (i think there may be a SYSTEM TABLE I can query to know it)
>|||On May 9, 1:54 pm, "Uri Dimant" <u...@.iscar.co.il> wrote:
> Benny
> select
> object_name(i.id) as table_name,
> groupname as [filegroup]
> from sysfilegroups s, sysindexes i
> where i.id in (object_id('tablename'))
> and i.indid < 2
> and i.groupid = s.groupid
> "Benny" <wuyueb...@.gmail.com> wrote in message
> news:1178688427.945823.281780@.e65g2000hsc.googlegroups.com...
> > there are several filegroups
> > I want to know whichfilegroupa table is using with a SQL query
> > (i think there may be a SYSTEM TABLE I can query to know it)
from your query, I found it is based on index's filegroup,
so how about if some table do not have index?
and how about .indid >= 2 ?
Subscribe to:
Posts (Atom)