|
Partitioning. Comes in horizontal and vertical flavors; the act of splitting a table over multiple files.
Bastard Programmer from Hell
|
|
|
|
|
|
|
countmein wrote: My question is whether it is a candidate for partitioning it?
Yes, it is.
Bastard Programmer from Hell
|
|
|
|
|
|
Do you have an obvious partitioning column?
|
|
|
|
|
Thank you for your replies. Yes, I do have a column(primary key) that starts from 1 and automatically generated by adding 1.
|
|
|
|
|
That's not really the best partitioning column.
What you want is to partition the table so that queries is only fetching or inserting data to and from one partition at a time, if possible.
For example, If you want to partition a sales table, the date column would normally be a good choice. Most updates, inserts and queries would be done on the current year partition.
|
|
|
|
|
I want to use Backgroundworker, Progressbar and Linq
Please, can i get some reference
I've alread written Database backup using Linq.How can i user backgroundworker?
|
|
|
|
|
|
wow..this is a big list..kudos to you Pravin..
|
|
|
|
|
If OP had used Google, he would have got more than this.....:lol
anyways thanks Prasad.....
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
Hi !
I need to track changes in the MS SQL 2008 DB, where the user works with the most updated data through views. One of my tasks is to show to the user two data chunks (before month and current) with highlighted changes.
CDC evidently works on the table basis. So my question: are there any tools/tutorials/walkthoughs that may help me recreate the view record and syncronize LSNs for different tables. In other words - represent the view record for certain point in time.
Thanks in advance.
Regards,
Gennady
My English is permanently under construction. Be patient !!
|
|
|
|
|
I have the following table structure:
Company:
Id (Int),
Name (VarChar)
Group:
Id (Int),
Name (VarChar)
Division:
Id (Int),
GroupId (Int) FK,
Name
Company_Group:
CompanyId (Int) FK,
GroupId (Int) FK
Team:
Id (Int),
DivisionId (Int) FK,
Name (VarChar)
I am trying to retrieve the Team Id and Name according to the CompanyId and DivisionId supplied.
Note that it is entirely possible that a team may belong to a division in multiple Company's.
I have tried various things but seem to get always get unwanted Teams in the results.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
try this
select t.id,t.name,d.name,g.name,c.*
from team t
inner join division d on d.id = t.divisionid
inner join [group] g on g.id = d.groupid
inner join Company_Group cg on cg.groupid = g.id
inner join company c on c.id = cg.companyid
Hope it will help you
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Sorry Blu_Boy, not quite the expected results. I may not have explained correctly,
I want to get only the Teams from the supplied Company (@CompanyId) and where the supplied DivisionId (and thus referenced GroupId) maps to the GroupId in Company_Group table.
This is where I'm stuck. This really should be super easy, but I'm not seeing it tonight.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
I may be wrong again with query.
select c.company,g.name,d.name,t.name
from Company_Group cg
inner join company c on c.id=cg.companyid
inner join [group] g on g.id=cg.groupid
inner join division d on d.id=g.id and d.groupid = cg.groupid
inner join team t on t.id = d.id
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Thanks for your time Blue_Boy, I have found that the design is flawed and there will have to be a work-around outside of the database.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Andy_L_J wrote: hanks for your time Blue_Boy,
My pleasure to help others
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi
I am busy working on a windows application to log working times of staff. The application is being developed using C# with SQL Server 2008 as the backend.
I have a [NetTime] column (Time data type) in my table in the database. I get the TimeSpan value by subtracting the official working hours and the actual working hours. This TimeSpan value can be positive or negative. I would like to store this value in the [NetTime] column, but the Time data type does not accept negative values.
What is the usual way of dealing with this problem? I will need to do calculations with the values in this column, for example to calculate the net or total time a staff member worked overtime or not.
Thank you.
Kobus
|
|
|
|
|
My advice would be to use a Long data type to store the Timespan. You can easily store this in the db using TimeSpan.Ticks() and convert back to a TimeSpan in your app using TimeSpan.FromTicks() . That way there is no problem storing positive or negative values.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Most timekeeping systems have a minimum timespan for calculations eg a minute, timespan.tick has no place in a timekeeping system. Therefore I would store the values as integers.
Sometimes you need to look at the real world, not the theoretical or technical capabilities of the system.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
A Time represents a point in time. A TimeSpan is a duration of time. They are fundamentally different things. 11 o'clock is a point in time, and so is 12 o'clock. The time span between them is 1 hour.
An analogy: the location of Paris is at 48°48'N 2°20'E. London is at 51°32'N 0°5'W. The distance between Paris and London is 211 miles. Location and distance are fundamentally different things and are not interchangeable.
Similarly, Time and TimeSpan are different things and are not interchangeable.
|
|
|
|
|
A (pretty bad) solution is to store the Abs(Timespan) value in one column and Sign(Timespan) in another.
The others have given you better answers .
|
|
|
|
|
I almost posted a "bad" solution with a disclaimer like yours. (store it as a character).
|
|
|
|