Unix Technical Forum

I wish to Avoid ...

This is a discussion on I wish to Avoid ... within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi All, I am working on Web Application which deals with history data for reports and keeping track of ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 08:29 AM
jsfromynr
 
Posts: n/a
Default I wish to Avoid ...

Hi All,
I am working on Web Application which deals with history data for
reports and keeping track of changes.
Current Solution :

1) For each Entity I am having a column TID (Tracking ID) which
keep on increasing for an instance of Entity. (so history and present
data in the same table) . It makes querying the data difficult.
2) I am also using month year table for Managing data i.e
<TableNameMMYYYY> for a given month and year

Purposed Soluion :

1) Using a seperate table so that history and present data is
placed seperately .

2) Store All data in one table <TableName>

Please guide me on advantages and disadvantages you pin point in the
two approaches.

With warm regards
Jatinder

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 08:30 AM
Simon Hayes
 
Posts: n/a
Default Re: I wish to Avoid ...

I'm not sure I understand your description - you say that you have
history and present data in the same table, but then you say you have
separate month/year tables. You should probably give some more
information about what your tables look like (ie a simplified CREATE
TABLE script), what data you have in each one, how many rows you have
per month etc. It's also a good idea to mention which version of MSSQL
you have.

Simon

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 08:30 AM
Erland Sommarskog
 
Posts: n/a
Default Re: I wish to Avoid ...

jsfromynr (jatinder.singh@clovertechnologies.com) writes:
> Current Solution :
>
> 1) For each Entity I am having a column TID (Tracking ID) which
> keep on increasing for an instance of Entity. (so history and present
> data in the same table) . It makes querying the data difficult.
> 2) I am also using month year table for Managing data i.e
><TableNameMMYYYY> for a given month and year
>
> Purposed Soluion :
>
> 1) Using a seperate table so that history and present data is
> placed seperately .
>
> 2) Store All data in one table <TableName>
>
> Please guide me on advantages and disadvantages you pin point in the
> two approaches.


It's a little unclear what you mean, but anyway having a table for each
month is not a good idea. Well, if you need to distribute the data it
could be, but in such case you should unite the data in a partitioned
view, and all your queries should use that view.

As for having a current data in a separate table, and adding this
data to a history table at the end of a day in a maintenance job can
sometimes be useful. As a matter of fact, this is routine in our
system.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 08:30 AM
jsfromynr
 
Posts: n/a
Default Re: I wish to Avoid ...

Thanks Erland,
Sorry If my description was not able to make the point / approach
clear. I am using a single table for a given month to hold that month's
changes/transactions
and for Enity there is no month year table

Erland I wish to ask you ;can I mail you my queries (I know posting
here on newsgroup will fetch me many answers) because most of the time
You,David Protas ,Anith and Celko are the ones who are active on these
newsgroups and provide elaborate and good answers . Everytime your
answer give something new to learn and you people bring bitter reality
to the poster especially Celko but that's what required . You all guys
doing great job.
Please keep reading my silly questions / answers
With warm regards
Jatinder

Erland Sommarskog wrote:
> jsfromynr (jatinder.singh@clovertechnologies.com) writes:
> > Current Solution :
> >
> > 1) For each Entity I am having a column TID (Tracking ID) which
> > keep on increasing for an instance of Entity. (so history and present
> > data in the same table) . It makes querying the data difficult.
> > 2) I am also using month year table for Managing data i.e
> ><TableNameMMYYYY> for a given month and year
> >
> > Purposed Soluion :
> >
> > 1) Using a seperate table so that history and present data is
> > placed seperately .
> >
> > 2) Store All data in one table <TableName>
> >
> > Please guide me on advantages and disadvantages you pin point in the
> > two approaches.

>
> It's a little unclear what you mean, but anyway having a table for each
> month is not a good idea. Well, if you need to distribute the data it
> could be, but in such case you should unite the data in a partitioned
> view, and all your queries should use that view.
>
> As for having a current data in a separate table, and adding this
> data to a history table at the end of a day in a maintenance job can
> sometimes be useful. As a matter of fact, this is routine in our
> system.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techinf...2000/books.asp


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-29-2008, 08:30 AM
Damien
 
Posts: n/a
Default Re: I wish to Avoid ...

jsfromynr wrote:
[snip]
> Erland I wish to ask you ;can I mail you my queries (I know posting
> here on newsgroup will fetch me many answers) because most of the time
> You,David Protas ,Anith and Celko are the ones who are active on these
> newsgroups and provide elaborate and good answers .


I'm hoping that Erland encourages you to continue posting your
questions here on the newsgroups - My first half-hour/hour of the
morning, I spend reading the newsgroups. There's lots of interesting
problems, questions and answers.

Occasionally, I try to help people using some of the knowledge I've
picked up along the way, but a lot of the time I just sit back and try
to absorb the knowledge that these people are kind enough to share - it
makes for a great learning experience. I would say that the schemas I
have worked on in the last few months are literally miles ahead of the
garbage I was producing two years ago :-)

Keep up the good work everybody, and keep the dicussions on usenet.

Just my two-penneth

Damien.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-29-2008, 08:31 AM
Erland Sommarskog
 
Posts: n/a
Default Re: I wish to Avoid ...

jsfromynr (jatinder.singh@clovertechnologies.com) writes:
> Sorry If my description was not able to make the point / approach
> clear. I am using a single table for a given month to hold that month's
> changes/transactions


As I said, that is a design that leads to problem, unless you unite
the tables in a partitioned view.

> Erland I wish to ask you ;can I mail you my queries


I prefer if you keep it to the newsgroups. Then other people can assist.
And, as Damien testified, other people can also benefit from the
exchange.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
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 02:21 AM.


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