http://blogs.msdn.com/b/larryosterman/archive/2004/03/30/104165.aspx
Category: Notes-To-Self
Things (usually programming tips) that *I* want to refer back to later. If it’s useful to me, maybe it’ll be useful to someone else.
Windows Batch Gotcha: Use REM Inside IF Blocks
Normally I comment out lines in a Windows batch script by prefixing them with “::”—it just looks better to me than “REM”. But today I found out the hard way (of course) that you can’t do that inside an IF block, or the script dies with… The syntax of the command is incorrect. http://www.petri.co.il/forums/showthread.php?t=43604
SSIS Conditional Expressions (Lightbulb:On)
I’ve often been confused and frustrated by conditionals ( … ? … : … ) in SSIS expressions. The concept is straightforward enough, but the syntax made it really hard for me to keep track in nontrivial cases. Then yesterday I had an epiphany: it’s much easier to keep them straight if you write them… Continue reading SSIS Conditional Expressions (Lightbulb:On)
Day-of-Week Differences in MySQL and MS SQL Server
Heads-up! In MySQL, WEEKDAY(‘2012-11-09′) = 4 (0-6 starting on Monday), but in SQL Server, DATEPART(dw,’11/09/2012′) = 6 (1-7 starting on Sunday). If you’re extracting data from MySQL to load into SQL Server, the correct translation is ((WEEKDAY(date)+1)%7)+1.
How to Override IE’s Compatibility View Behavior On Intranet Sites
To force IE to edge mode (even on intranet sites, where IE would otherwise use compatibility mode), the server needs to send X-UA-Compatible as an HTTP header. Using a meta element in the document head doesn’t work reliably. I found the answer buried in this Stack Overflow thread. In my case, I was working on… Continue reading How to Override IE’s Compatibility View Behavior On Intranet Sites
Generating a Range of Dates in MySQL
Working on a report from a MySQL database, I needed a table of all dates for the next year. With SQL Server (2005 and later) there’s a CTE/recursive method to do this pretty elegantly, but I couldn’t find anything similar for MySQL. All the solutions I found involved temporary tables, loops, and/or stored procedures–none of… Continue reading Generating a Range of Dates in MySQL