October 2011
M T W T F S S
    Nov »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Problem with a MTD query

I was running a query today and was not able to SUM by the current month. I checked the code and didn’t see any issues there, but when I looked at the variables it was pretty obvious.

DECLARE @targetdate VARCHAR(8) DECLARE @previousdate VARCHAR(8) DECLARE @currentmonth INT DECLARE @currentday INT

SET @targetdate = CONVERT(VARCHAR(8), GETDATE() [...]

Delete all rows in database

I recently ran into a situation where I had to truncate an entire database. Usually not a good sign, but this was to clean out a archive/logging database for someone to practice on. The script below works well and is based on sp_ms_foreachtable, which is unsupported but very useful.

–First, disable all constraints on all [...]

New theme for the blog

I have finally changed the theme on the blog. I still have not figured out all the details and completed the customization, mostly due to the new theme having many more options.

Now for some content…

Testing

Posting from my phone.

Google+ Hangouts

The more I use google+, (which is not very much) the more I like it. I set up a meeting in a Hangout last week and I really think it went well. Much better than chatting or a conference call.

I usually don’t like social networking, but so good so far.

I’m going to be [...]