0

Sorry for my English.

There is database on SQL Server 2005 Enterprise. I wrote program which splits all tables on fileGroups by datetime. But the problem is that database schema is not designed for it and most information stays on the PRIMARY filegroup.

Please tell me how I can spread (split) tables onto two or more database servers for increased performance?

2 Answers 2

1

Are you looking for the syntax on how to move a table from one file group to another? See ALTER TABLE

ALTER TABLE dbo.MyTable
MOVE TO MyNewFileGroup
Sign up to request clarification or add additional context in comments.

6 Comments

I know how to move a table from one file group to another. I am interested in move some tables to another ms sql server.
Server A, database B, has table C. You want to move table C to Server D? Do all the applications know that this table has moved or do you need something to keep a copy of that table on both servers in synch?
Could you tell me how to create partition function which take as argument size of table?
The creation of a partition function isn't really aligned with sizes. You could probably fake it if your table(s) have an auto-increment key on them, then you could define ranges for whatever size you feel appropriate. That said, a partition function isn't going to help you accomplish putting data on a different server. It has a different purpose.
I do this with date time. CREATE PARTITION FUNCTION Partitions_PFN_{0}(datetime) AS RANGE LEFT FOR VALUES ({1}), but it not useful for me. most tables have not auto-increment fields, pk field is binary
|
0

It sounds to me like you need to look into MS SQL Server's partitioning capabilities. You should not be doing this manually. Let the database solve that issue for you.

1 Comment

I just want to know how I can create distributed database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.