Viewing 15 posts - 1,786 through 1,800 (of 2,894 total)
...
Try adding this into the original sample data
SELECT 'Jun 1 2011 12:00AM','1','10','20' UNION ALL
The results of the two queries are different.
My query will only work if status never...
March 27, 2012 at 8:24 am
...
Why would you want to cache ranges of keys when using Guids? Makes no sense at all. The main reason for using guids if allocating keys in the front/middle tier...
March 27, 2012 at 7:58 am
CELKO (3/26/2012)
I hate XML inside SQL. I also hate CLRs and anything that is not pure SQL...
Very puritan's american view :hehe:
That is pure "culture of hate" propaganda...:w00t:
Lets continue hate candidates:
1....
March 27, 2012 at 7:44 am
I still couldn't get it from your explanation, but looks like I do see now what you want ...
Lets create some more test data (around 1.3 millions records)
declare @i int
set...
March 27, 2012 at 7:21 am
...
No they don't, but if doing client-side allocation of int values is horridly hard. Can't use a incrementing key without huge amounts of logic to check for/prevent race conditions, and...
March 27, 2012 at 6:18 am
Your sample data 1:
MonthItemIDCount ACount B
2011-01-01 00:00:0011020
2011-02-01 00:00:0011020
Expected:
ItemID[Count A][Count B]Start Month End Month
1102001/01/2011 00:0001/03/2011 00:00
Your sample data 2:
MonthItemIDCount ACount B
2011-04-01...
March 27, 2012 at 5:31 am
GilaMonster (3/27/2012)
Eugene Elutin (3/27/2012)
Nothing wrong with a guid primary key...
Nothing wrong! But with a real life experience you learn, that it would be much better to stick with INTs or...
March 27, 2012 at 5:23 am
If there is no 'next month' the the value is NULL (indicating the current state for the item).
Which combination of id's in a sample data you gave has no...
March 27, 2012 at 4:51 am
3
2008 - 2005 = 3 :hehe:
March 27, 2012 at 4:34 am
so we have
MonthItemIDCount ACount B
2011-01-01 00:00:0011020
2011-01-01 00:00:002100200
2011-02-01 00:00:0011020
2011-02-01 00:00:002100200
2011-03-01 00:00:0011525
2011-03-01 00:00:002100250
2011-04-01 00:00:0011525
2011-04-01 00:00:002200250
2011-05-01 00:00:0011525
2011-05-01 00:00:002200250
So the result I am after would be:
ItemID[Count A][Count B]Start MonthEnd Month
1102001/01/201101/03/2011
1152501/03/2011NULL
210015001/01/201101/04/2011
220015001/04/2011NULL
Could you please check...
March 27, 2012 at 4:19 am
Nothing wrong with a guid primary key...
Nothing wrong! But with a real life experience you learn, that it would be much better to stick with INTs or BIGINTs for many,...
March 27, 2012 at 3:35 am
...
The worst part, is that even my boss knows there's a better way.
It's just company protocol 🙁
I know couple of good ones, who help companies going to administration.
Company protocol stating...
March 23, 2012 at 11:02 am
njdevils39 (3/23/2012)
Can you expand my select statement to include the 4 columns I ask for from the rate_history field
Yes, sure, no problem at all. It shows how to do exactly...
March 23, 2012 at 10:54 am
Ah, I see! It is easy. We have done it before here. Link to solution:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 23, 2012 at 10:37 am
March 23, 2012 at 10:36 am
Viewing 15 posts - 1,786 through 1,800 (of 2,894 total)