Unix Technical Forum

derived horizontal partitioning on SQL server 2000

This is a discussion on derived horizontal partitioning on SQL server 2000 within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> hello i want someone to help me in solving a problem in sql server 2000 considering that i have ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 10:01 PM
Nada Sherief
 
Posts: n/a
Default derived horizontal partitioning on SQL server 2000


hello

i want someone to help me in solving a problem in sql server 2000

considering that i have a table named PAY(TITLE, SAL) where TITLE is the
primary key of this table
also this table is related to another one named EMP, where the other table
has a foreign
key to this table.

table EMP(ENO, ENAME, TITLE) where ENO is the primary key and it is related
to another table that contains a foreign key to this table.

i want to perform Derived horizontal fragmentation (partitioning) on SQL
server 2000 for EMP:

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.

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.

Thanx al


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 10:01 PM
=?Utf-8?B?Ui5E?=
 
Posts: n/a
Default RE: derived horizontal partitioning on SQL server 2000

My previous answer to your latest question will solve the problem
--
Regards
R.D
--Knowledge gets doubled when shared


"Nada Sherief" wrote:

>
> hello
>
> i want someone to help me in solving a problem in sql server 2000
>
> considering that i have a table named PAY(TITLE, SAL) where TITLE is the
> primary key of this table
> also this table is related to another one named EMP, where the other table
> has a foreign
> key to this table.
>
> table EMP(ENO, ENAME, TITLE) where ENO is the primary key and it is related
> to another table that contains a foreign key to this table.
>
> i want to perform Derived horizontal fragmentation (partitioning) on SQL
> server 2000 for EMP:
>
> 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.
>
> 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.
>
> Thanx all
>
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 10:01 PM
JT
 
Posts: n/a
Default Re: derived horizontal partitioning on SQL server 2000

If PAY is to be partitoned based on Salary and an employees's salary
increases from $290,000 to $310,000, would their related salary information
need to be deleted from PAY1 and re-inserted into PAY2? Generally speaking,
tables are partitioned because there is large volume of rows, like >
1,000,000, and the data is split between tables based on something like
EntryDate, RegionID or some other ID that is static and indexed.

Is there a one to many relationship between EMP and PAY?

Perhaps you are just wanting to subset results for reporting purposes?


"Nada Sherief" <nadasherief@hotmail.com> wrote in message
news:7c7276cf31f68c7b21d8f03cf12@news.microsoft.co m...
>
> hello
> i want someone to help me in solving a problem in sql server 2000
>
> considering that i have a table named PAY(TITLE, SAL) where TITLE is the
> primary key of this table
> also this table is related to another one named EMP, where the other table
> has a foreign key to this table.
>
> table EMP(ENO, ENAME, TITLE) where ENO is the primary key and it is
> related to another table that contains a foreign key to this table.
>
> i want to perform Derived horizontal fragmentation (partitioning) on SQL
> server 2000 for EMP:
>
> 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.
>
> 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.
>
> Thanx all
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 10:01 PM
Nada Sherief
 
Posts: n/a
Default Re: derived horizontal partitioning on SQL server 2000

Hello JT,

the answer for the first question is consider that i have some data in the
tables and i don't care if they are going to be changed or not.
and yes there is a one to many relationship between EMP and PAY
so

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.

please help me find a solution to this problem

Thanx



If PAY is to be partitoned based on Salary and an employees's salary
> increases from $290,000 to $310,000, would their related salary
> information need to be deleted from PAY1 and re-inserted into PAY2?
> Generally speaking, tables are partitioned because there is large
> volume of rows, like > 1,000,000, andda the ta is split between tables
> based on something like EntryDate, RegionID or some other ID that is
> static and indexed.
>
> Is there a one to many relationship between EMP and PAY?
>
> Perhaps you are just wanting to subset results for reporting purposes?
>
> "Nada Sherief" <nadasherief@hotmail.com> wrote in message
> news:7c7276cf31f68c7b21d8f03cf12@news.microsoft.co m...
>
>> hello
>> i want someone to help me in solving a problem in sql server 2000
>> considering that i have a table named PAY(TITLE, SAL) where TITLE is
>> the
>> primary key of this table
>> also this table is related to another one named EMP, where the other
>> table
>> has a foreign key to this table.
>> table EMP(ENO, ENAME, TITLE) where ENO is the primary key and it is
>> related to another table that contains a foreign key to this table.
>>
>> i want to perform Derived horizontal fragmentation (partitioning) on
>> SQL server 2000 for EMP:
>>
>> 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.
>>
>> 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.
>>
>> Thanx all
>>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 10:01 PM
JT
 
Posts: n/a
Default Re: derived horizontal partitioning on SQL server 2000

I think that reading up on Views will solve your problem.

Related partitioned tables are typically joined (vertically) or unionized
(horizontally) by implementing views.

For example:

CREATE view InvoiceHistory
as
Select * from INVOICES_2004 UNION ALL
Select * from INVOICES_2003 UNION ALL
Select * from INVOICES_2002
GO

This would allow querying invoices across all years like so:

select * from InvoiceHistory

Here are a couple of good links describing this in more detail:
http://msdn.microsoft.com/library/de...itionsInDW.htm
http://www.microsoft.com/technet/pro...2005/spdw.mspx

However, notice that these articles revolve around data warehousing
concepts. Generally, speaking tables are not partitioned, unless you are
wanting to segment a large amount of data for performance reasons. It sounds
like you are wanting to partition related data into seperate tables for what
you think are logical reasons, but this de-normalizes your database model
and provides no benefit. All it would do is make your queries more complex.
http://en.wikipedia.org/wiki/Database_normalization

If you are wanting to retrict update to only specific columns in a table,
then consider implementing a view that only returns those updatble columns
and give the application access to that rather than the base table.
http://msdn.microsoft.com/library/de...urity_5whf.asp


"Nada Sherief" <nadasherief@hotmail.com> wrote in message
news:7c7276cf35f88c7b2bed08573c2@news.microsoft.co m...
> Hello JT,
>
> the answer for the first question is consider that i have some data in the
> tables and i don't care if they are going to be changed or not.
> and yes there is a one to many relationship between EMP and PAY
> so
>
> 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.
>
> please help me find a solution to this problem
>
> Thanx
>
>
>
> If PAY is to be partitoned based on Salary and an employees's salary
>> increases from $290,000 to $310,000, would their related salary
>> information need to be deleted from PAY1 and re-inserted into PAY2?
>> Generally speaking, tables are partitioned because there is large
>> volume of rows, like > 1,000,000, andda the ta is split between tables
>> based on something like EntryDate, RegionID or some other ID that is
>> static and indexed.
>>
>> Is there a one to many relationship between EMP and PAY?
>>
>> Perhaps you are just wanting to subset results for reporting purposes?
>>
>> "Nada Sherief" <nadasherief@hotmail.com> wrote in message
>> news:7c7276cf31f68c7b21d8f03cf12@news.microsoft.co m...
>>
>>> hello
>>> i want someone to help me in solving a problem in sql server 2000
>>> considering that i have a table named PAY(TITLE, SAL) where TITLE is
>>> the
>>> primary key of this table
>>> also this table is related to another one named EMP, where the other
>>> table
>>> has a foreign key to this table.
>>> table EMP(ENO, ENAME, TITLE) where ENO is the primary key and it is
>>> related to another table that contains a foreign key to this table.
>>>
>>> i want to perform Derived horizontal fragmentation (partitioning) on
>>> SQL server 2000 for EMP:
>>>
>>> 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.
>>>
>>> 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.
>>>
>>> Thanx all
>>>

>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com