Sie sind auf Seite 1von 2

7/3/2014

microsoft public sqlserver programming


SQL server 2000 fragmentation

SQL server 2000 fragmentation


Search
(too old to reply)

Log in / Sign up

John Bell Hi I think you are talking about partitioning rather than fragmentation? Attachment are not always viewable from certain newsreaders or ISPs, therefore it may have been better to include the DDL code See http://www.aspfaq.com/etiquette.asp?id=5006 To horizontally partition you need to define a where clause. You can do this in a view if you don't want the overhead of maintaining two tables. You will need to add the correct column names: CREATE VIEW PROJ1 AS SELECT PNO, Budget, col1, col2, col3,... FROM PROJ WHERE budget < 200000 CREATE VIEW PROJ2 AS SELECT PNO, Budget, col1, col2, col3,... FROM PROJ WHERE budget >= 200000 To partition vertically you only need to select the columns that you require: CREATE VIEW PRO1 AS SELECT PNO, Budget, col1, col2, col3... FROM PROJ CREATE VIEW PRO2 AS SELECT PNO, col4, col5... FROM PROJ The rest I think you should be able to work out from that. John

hace 8 aos

4 Replies 1 View
Closed for new replies Disable enhanced parsing Permalink to this page Show on narkive RT

Similar Topics
None

hello i want someone to help me in solving a problem in sql server 2000 i have this simple Entity relationship diagram drawn in the attached file with its realtionships considering that i have two instances of SQL server on my PC one of them has the attached ERD on it a-I want to divide the table PROJ into 2 relations. Subrelation PROJ1 contains information about projects whose budgets are less than $200,000, whereas PROJ2 stores information about projects with larger budgets. b- Vertical fragmentation as an example take the same relation PROJ and divide it vertically into two subrelations PRO1 and PRO2. PRO1 contains only the information about project budgets, whereas PRO2 contains the project names and locations. It is impoprtant to notice that the primary key to the relation (PNO) is included in both fragments. first: I want to divide the table PAY into 2 relations. Subrelation PAY1 contains information about job titles whose salaries are less than or equal to $300,000, whereas PAY2 stores information job titles with larger salaries. second: I want to divide the table EMP into 2 relations. Subrelation EMP1 contains information about employees whose salaries are less than or equal to 300,000, whereas EMP2 stores information about projects with larger salaries. there is a relationship between EMP and PAY and since the table PAY will be horizontally fragmented so the other table EMP should be derived horizontally fragmented. please try to send me the code (with comments) and a detailed step-by-step of how to run this code so that i have these tables fragmented on the two servers. or if they don't need code, i hope you send me a step-by-step support of how to do all these fragmentations on SQL server 2000

ML Are you talking about partitioned views? There are a few examples in Books Online. Start here http://msdn.microsoft.com/library/default.asp?url=/library/enus/createdb/cm_8_des_06_17zr.asp ML Kent Tegels Hello Nada,
hi, i want someone to help me in solving a problem in sql server 2000

hace 8 aos

hace 8 aos

http://microsoft.public.sqlserver.programming.narkive.com/skn8bQ56/sql-server-2000-fragmentation

1/2

7/3/2014

SQL server 2000 fragmentation

considering that i have a table named PROJ(JNO,JNAME,BUDGET,LOC) where JNO is the primary key of this table also this table is related to another one, where the other table has a foreign key to this table.

Is SQL 2000 an absolute requirement? This might be much easier with SQL Server 2005. Thank you, Kent Tegels DevelopMentor http://staff.develop.com/ktegels/ Nada Sherief Hello Kent, yes it is a requirement to be on SQL server 2000 and i would be very thankful if you told me the answer on SQL server 2000 and 2005 Thanx so much for your concern Nada
Post b y Kent Tegels Hello Nada, hi, i want someone to help me in solving a problem in sql server 2000 considering that i have a table named PROJ(JNO,JNAME,BUDGET,LOC) where JNO is the primary key of this table also this table is related to another one, where the other table has a foreign key to this table. Is SQL 2000 an absolute requirement? This might be much easier with SQL Server 2005. Thank you, Kent Tegels DevelopMentor http://staff.develop.com/ktegels/

hace 8 aos

Kent Tegels Hello Nada, Sorry, I don't have SQL2000 installed locally to work out an example for that, but here's a SQL 2005 example. http://www.sqljunkies.com/WebLog/ktegels/articles/SimplePartitionedTable.aspx Thanks! Kent Tegels DevelopMentor http://staff.develop.com/ktegels/

hace 8 aos

SQL server 2000 fragmentation


feedback

Search
Contents in English

http://microsoft.public.sqlserver.programming.narkive.com/skn8bQ56/sql-server-2000-fragmentation

2/2

Das könnte Ihnen auch gefallen