Viewing 15 posts - 3,811 through 3,825 (of 3,956 total)
One caveat however, is the filter is going to be an issue since this will span across some 50k items. I just used this as a sample set :). I...
April 9, 2012 at 9:06 pm
My apologies Mr. Celko but I disagree with you, not on the grounds that you're applying MySQL to a SQL Server problem, but rather to agree with the OP that...
April 9, 2012 at 8:17 pm
Lynn,
Not really true. What if someone comes along and sees some code that will work for their task, but doesn't realize that the code they copied is inefficient for the...
April 9, 2012 at 7:16 pm
Jeff,
Thanks for the compliment even if it was a bit hesitant.
You can't blame me for wanting to have a bit of fun with this one as I'm still in my...
April 9, 2012 at 6:36 pm
Thanks Jeff. Thought I had a brain freeze there.
If you like truly cryptic solutions that can lead to job security, you may want to consider this:
DECLARE @l TABLE (ID...
April 8, 2012 at 10:47 pm
I must be missing something here... Like why is a split string function needed at all?
DECLARE @l TABLE (ID INT, [Name] VARCHAR(30), Location VARCHAR(100))
INSERT INTO @l (ID, [Name], Location)
SELECT 1,...
April 8, 2012 at 9:50 pm
If you don't need @period for anything, you can do it this way.
declare @end datetime
declare @start datetime
set @start = '2011-01-12 19:59:00.000'
IF DATENAME(dw, @start) IN ('Sunday')
select @start = DATEADD(Day, DATEDIFF(Day, 0,...
April 8, 2012 at 9:46 pm
THANK YOU ALL !!, it's working this way:
DECLARE @minage INT
DECLARE @maxage INT
SET @minage = @FromAge
SET @maxage = @ToAge
if @minage > @maxage set @minage = @maxage + @minage
if...
April 5, 2012 at 8:17 pm
Also, I think your repeat counts are wrong.
--LocCustomers(Visits)
--11(2), 2(2)
--21(1), 3(2), 4(1)
--31(1), 3(1), 4(2), 5(3)
So now, counting repeats I get:
Loc Repeats
1 2
2 1
3 ...
April 5, 2012 at 7:42 am
If I may, I'd like to ask a question as I've taken an interest in this problem.
If I construct a list of locations, and assign to it the customers that...
April 5, 2012 at 6:53 am
Phil,
I am no expert with Dynamic SQL as I try to avoid it. However I realized early on that you might want to do something like that. The...
April 4, 2012 at 6:38 pm
Bad data? When do we ever store bad data in our databases?
Might work if you changed all data to data+'__' though.
April 4, 2012 at 7:25 am
I found myself with some unexpected time on my hands this morning, so here is the solution decomposition. Note that I've slightly changed the code in a couple of...
April 3, 2012 at 9:02 pm
Old or new, this is pretty easy:
DECLARE @d TABLE (data VARCHAR(max))
INSERT INTO @d (data)
SELECT 'AIT_FIT_projecto and moonbeat'
UNION ALL SELECT 'AIT_FIT_projectofile where handled'
UNION ALL SELECT 'AIT_FIT_pritibabe every way'
SELECT SUBSTRING(data, 1, CHARINDEX('_',...
April 3, 2012 at 7:06 pm
Viewing 15 posts - 3,811 through 3,825 (of 3,956 total)