The slow query log can be used to find queries that take a long time to execute and are therefore candidates for optimization. If you want to enable slow query log on your Amazon MySQL RDS instance, you need to be aware of 2 things :- To be able to enable and disable slow query log […]
Today, I encountered an error with one of my Railo powered websites (with MySQL as database) – it started throwing an error wherever column aliases were being used in the queries. On a cfdump, the column aliases were just not there in the resultset. The original column name was, though. Running the same query in […]
We are using ANT heavily in our current Project to automate builds for different environments. One of the requirements was to execute a Stored procedure from one of the ANT tasks. That sounds straightforward. Use the ANT Sql task and that should do it. But apprently, it turns out that using “EXEC” commands within a […]
I am working on a project that has a requirement to report some statistics historically. e.g. how many views a product had this week, this month, this year etc. how many comments were made on a product in the last quarter….and so on… although doing something like this does not sound overly complex when you […]
I am sure this is a pretty common scenario in every developer’s coding journey. So I thought I would write up a little post mainly to remind me different ways of doing this as I always end up searching for it whenever I need this. Lets say you have a stored procedure that takes input […]
I came across a nice tip while reading this article. If you want to get the number of rows in a table , you would normally do a select count(*) from tbl query, which does a table scan and can be a little time consuming query if the table has millions of rows. This little […]
Red-Gate software are giving away a free eBook “Mastering SQL Server 2005 Profiler”. I have just downloaded it and some of the topics could be quite useful as a developer. Especially the ones under “How Profiler can help Developers”. I just thought I would blog about it so anyone else interested can download as well.
I was recently stuck with a problem where I had to loop over a self referencing table (unlimited parent child relationships from the same table) and generate a tree structure upto n levels and because my table didnt have the levels defined in it, the tree leveles were to be defined at run time. What […]
I have always used INFORMATION_SCHEMA to some extent in some way or the other. Its quite handy to get information about database objects. This morning, I saw a nice article about this on SqlServerCentral. The author’s name is Mike and he does a pretty good job in explaining the concepts. There is also a stored […]
I was reading some SQL tips and found this small but quite handy tip. If you have a boolean column in your database which holds values like 0 and 1 , you can modify your Select queries to represent that data as a Yes or No by doing this. [sql]SELECT SUBSTRING(‘YesNo’, 4 – 3 * […]
Most recent comments