• . ´¯` . • Brany • . ´¯` . • says:

okay. what’s ^ in new york?

• . ´¯` . • Brany • . ´¯` . • says:

er, i think that’s where you’re from…

Dave Bitton (Gold Medal Coder) says:

ever listen to Black Eyed Peas?

Dave Bitton (Gold Medal Coder) says:

actually Jersey

Dave Bitton (Gold Medal Coder) says:

the biggest is the republican convention nxt wk

• . ´¯` . • Brany • . ´¯` . • says:

ah

• . ´¯` . • Brany • . ´¯` . • says:

bloggers are buzzing about the RNC

Dave Bitton (Gold Medal Coder) says:

NS

• . ´¯` . • Brany • . ´¯` . • says:

i saw pics of naked protestors

• . ´¯` . • Brany • . ´¯` . • says:

heh

Dave Bitton (Gold Medal Coder) says:

gotta love naked protest

• . ´¯` . • Brany • . ´¯` . • says:

lol

• . ´¯` . • Brany • . ´¯` . • says:

do you read gothamist?

Dave Bitton (Gold Medal Coder) says:

so long as they’re not fugly

• . ´¯` . • Brany • . ´¯` . • says:

best.blog.ever.

• . ´¯` . • Brany • . ´¯` . • says:

lol, true..

Dave Bitton (Gold Medal Coder) says:

that;s quite a stmt

Dave Bitton (Gold Medal Coder) says:

link?

• . ´¯` . • Brany • . ´¯` . • says:

www.gothamist.com

• . ´¯` . • Brany • . ´¯` . • says:

it’s all about new york

• . ´¯` . • Brany • . ´¯` . • says:

but so well written

Dave Bitton (Gold Medal Coder) says:

you do know i used to work a 1/2 block from the garden

Dave Bitton (Gold Medal Coder) says:

i would have taken nxt wk off

Dave Bitton (Gold Medal Coder) says:

i wouldn’t be suprised if the oiffice is closed

• . ´¯` . • Brany • . ´¯` . • says:

oh, omg i lived 2 blocks from the garden!!

• . ´¯` . • Brany • . ´¯` . • says:

wierd

Dave Bitton (Gold Medal Coder) says:

i worked on 32 btw 6 and 7

• . ´¯` . • Brany • . ´¯` . • says:

ah

Dave Bitton (Gold Medal Coder) says:

“This is New York. Of course, we had seven naked people on Eighth Ave. What’s the question?”

• . ´¯` . • Brany • . ´¯` . • says:

well it’s more than 2 blocks… 33rd and ave of americas

• . ´¯` . • Brany • . ´¯` . • says:

hehehehe

• . ´¯` . • Brany • . ´¯` . • says:

did you see the fugly pedrestrian bridge they built for the rnc

Dave Bitton (Gold Medal Coder) says:

there’s residential adjacent to herald sqr?

• . ´¯` . • Brany • . ´¯` . • says:

it’s an eyesore

Dave Bitton (Gold Medal Coder) says:

i see

• . ´¯` . • Brany • . ´¯` . • says:

yep

Dave Bitton (Gold Medal Coder) says:

what st is that?

• . ´¯` . • Brany • . ´¯` . • says:

above stores…

• . ´¯` . • Brany • . ´¯` . • says:

know what I mean?

Dave Bitton (Gold Medal Coder) says:

yes

• . ´¯` . • Brany • . ´¯` . • says:

yeah.

• . ´¯` . • Brany • . ´¯` . • says:

it was a crappy place actually

Dave Bitton (Gold Medal Coder) says:

http://www.nytimes.com/2004/08/27/politics/campaign/27protest.html?ex=1251345600&en=43f41670382a6a35&ei=5090&partner=rssuserland

Dave Bitton (Gold Medal Coder) says:

even w./ that pic i still can;t firgure the st

Dave Bitton (Gold Medal Coder) says:

duh

Dave Bitton (Gold Medal Coder) says:

says 8th

Dave Bitton (Gold Medal Coder) says:

oh, and btw

Dave Bitton (Gold Medal Coder) says:

bush can’t stop aids

Dave Bitton (Gold Medal Coder) says:

3rd world developing nations with more than 50% of their population infected need to stop aids

• . ´¯` . • Brany • . ´¯` . • says:

yes!

• . ´¯` . • Brany • . ´¯` . • says:

i agree

• . ´¯` . • Brany • . ´¯` . • says:

and aids infected ppl need to stop f*cking

• . ´¯` . • Brany • . ´¯` . • says:

(excuse the blunt language)

Dave Bitton (Gold Medal Coder) says:

and ya know what? i don;t the usa should do a damn thing about problems in any other nation besides our own

• . ´¯` . • Brany • . ´¯` . • says:

that’s so true

• . ´¯` . • Brany • . ´¯` . • says:

we have poor ppl here…

• . ´¯` . • Brany • . ´¯` . • says:

sick ppl

• . ´¯` . • Brany • . ´¯` . • says:

mental ppl

• . ´¯` . • Brany • . ´¯` . • says:

everything everyone else has

Dave Bitton (Gold Medal Coder) says:

i’m sorry, but it;s USA 1st, the world 2nd

• . ´¯` . • Brany • . ´¯` . • says:

yeah

• . ´¯` . • Brany • . ´¯` . • says:

are you a dem or rep?

Dave Bitton (Gold Medal Coder) says:

here;s something that needs to happen _before_ any group gets help, their needs to be an economic insentive to helping them

• . ´¯` . • Brany • . ´¯` . • says:

true…

Dave Bitton (Gold Medal Coder) says:

what economix incentive does a corporation have to help tjhe poor? none.

• . ´¯` . • Brany • . ´¯` . • says:

then again,. some countries have nothign to give

Dave Bitton (Gold Medal Coder) says:

and in case you haven’t taken a business class, but the number 1 objective of any employee is to increase shareholder equity

Dave Bitton (Gold Medal Coder) says:

and you don;t increase share holder equity by giving shit away for free

• . ´¯` . • Brany • . ´¯` . • says:

true.

Dave Bitton (Gold Medal Coder) says:

and until such time as there is a return on investment for helping the disadvantaged, it’ll have to accomplished by the fed, and that is as good as nill.

Dave Bitton (Gold Medal Coder) says:

i’ll give you a great exampole

• . ´¯` . • Brany • . ´¯` . • says:

are you a big economics guy?

Dave Bitton (Gold Medal Coder) says:

ever look at your phone bill?

• . ´¯` . • Brany • . ´¯` . • says:

you really seem to know your stuff.

• . ´¯` . • Brany • . ´¯` . • says:

umm… kinda. i don’t pay for it so…

Dave Bitton (Gold Medal Coder) says:

there’s something called a Universal Service Fee

• . ´¯` . • Brany • . ´¯` . • says:

okay, i’ve seen it

Dave Bitton (Gold Medal Coder) says:

that;s was a tax imposed by the fed to help pay for telecommunications for poor and remote regions of the country

• . ´¯` . • Brany • . ´¯` . • says:

oohh….

• . ´¯` . • Brany • . ´¯` . • says:

so some poor ppl don’t pay to have a phone?

Dave Bitton (Gold Medal Coder) says:

why you ask? because there is no economic incentive for telecom providers to do it themselves, and therefore the fed had to step in

Dave Bitton (Gold Medal Coder) says:

it’s more has to do w/ infrastructure

• . ´¯` . • Brany • . ´¯` . • says:

oh i see

Dave Bitton (Gold Medal Coder) says:

the fed gives that money back to the telecoms to aid in the build-out of infrastructure that they otherwise would not have implemented because it doesn;t make economic sense. the ROI would be negative, and that is a no-no

• . ´¯` . • Brany • . ´¯` . • says:

right

• . ´¯` . • Brany • . ´¯` . • says:

they won’t sacrifice anything

Dave Bitton (Gold Medal Coder) says:

yeah, sure, there’s _some_ economic incentive to finding an HIV vacine, someone gets to sell it

Dave Bitton (Gold Medal Coder) says:

why would/should they?

• . ´¯` . • Brany • . ´¯` . • says:

but the research, i think would cost oodles more than the money they’ll make of the meds

Dave Bitton (Gold Medal Coder) says:

your absolutely right, and that is why it’s taking the time that it is

Dave Bitton (Gold Medal Coder) says:

the fed doesn;t have the $, and therefore hiv research is beholdent upon private donations and some pharama $

Dave Bitton (Gold Medal Coder) says:

pharma

• . ´¯` . • Brany • . ´¯` . • says:

yes…

Dave Bitton (Gold Medal Coder) says:

i should blog this conversation verbatim

• . ´¯` . • Brany • . ´¯` . • says:

heheh

datetime comparisons in T-SQL aren’t always a walk in the park. One of the most annoying things that someone would need to overcoming is filtering solely on the year, month, and day component of a datetime field. This is further complicated by how .NET initializes a DateTime object.

When a DateTime object is instantiated without secifying the time, it is set to 12:00AM (midnight). When you pass the DateTime object to an SqlParameter, the following is sent over the wire:


     exec GetContracts @CreationDate = 'Aug 13 2004 12:00:00:000AM'

A further complication is that even if you pass creationDate.ToShortDateString() (assuming of course that your DateTime object in code is ‘creationDate’) to the Value of your SqlParameter, the afortementioned value is still passed to the stored procedure. This is because the stored procedure parameter is typed as datetime. Now, how do you overcome this?

With values in the table such as ‘2004-08-13 13:02:44.767’, you’ll never be able to match ‘Aug 13 2004 12:00:00:000AM’, and therefore no rows will be returned. The way I have overcome this problem is to make use of DATEDIFF and the dayofyear DATEPART. By using the following in your WHERE clause:


     DATEDIFF(dayofyear, @CreationDate, Contracts.CreationDate) = 0

This will return 0 whenever the day of the year is the same in both the table, and the stored procedure parameter. Any other day will either cause DATEDIFF to return a non-zero value. You can also use this if you want everything from this date and on (or before) by changing the comparitor to > or < as appropriate. Sproc on!

The ability to page in SQL Server is one of those things that everyone wants, but can’t quite seem to get from Microsoft. Many ideas have been posted, each claiming to be _the_ way to do it. In the spirit of mine is better than yours, I’ve implemented my own paging scheme.

A feature that is in the upcoming version of SQL Server is the ability to supply a variable to the TOP keyword. Well, as it turns out, this functionality does exist in SQL Server 2000. The only difference is the syntax. To limit the number of rows returned from a query based on a variable is to use SET ROWCOUNT @Foo. Don’t forget, however, to reverse that after the query by setting ROWCOUNT to 0.

The principle of which this works is that I return all of the primary keys in a table into a table datatype up to and including the record that i want to start at. Then I grab that value by selecting the TOP 1 from that temp table, ordering by the value, descending. Now I have the starting primary key value.

At this point, it’s a matter of looping through the records, row by row until I have filled my cache table with a single page’s worth of data. Once that is complete, I return the contents of the cache table. In addition, in the form of an OUTPUT param, I return the total number of rows in the table. I have this value as a result of a sanity check that stops the proc if we are requesting a page of data that is past the end of the table.

I hope this sproc finds you well.

5. Dan Black Belt

Your skills as a both a teacher and practicioner of MT-Do are now at a level few people will reach. You are most likely a worthy contributor in spreading the noble practice of MT-Do to others.

Take the MT-Do test