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.
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 on multiple lines. Continue reading “SSIS Conditional Expressions (Lightbulb:On)”
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
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 a WordPress theme, so I added
at the top of header.php.
UPDATE 3/13/2014: I have now verified the IIS method linked above.
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 these were viable options for me because it’s a production database and I can’t just go changing things. I needed a simple query, and since I couldn’t find one, I made one.
It’s ugly, but it did the job. Continue reading “Generating a Range of Dates in MySQL”