• After all these years, I am embarrassed to say that I don't write too much comments in my procedures.

    I try not to use cursor, probably because when I first learned SQL Server SQL, every time I wrote a cursor, the DBA cursed me and refused to put in production until I changed it so I just used not using it.

    When I write my code, I try to make it easy to read also try to make it more generic and dynamic. For example when I created the reporting system, I wrote the procedure and the DTS package so when I add a new report, it did not need to change anything. The developer did not need to write a new DTS package to extract the data and put it into the table. The generic procedure I wrote taking care of it. All the developer needed was putting the report, the format file, the report file, the table name into a Reporting table. Also the DTS package I created, when the DBAs moved from one server to another server, they don't need to open the package and changed the server name. I had an environment table. It would read the table and change the server when it ran the package.

    This kind of things challenge me, how to make the procedure easy to change or more dynamic, how to make it run faster, what kind of index I should put in the table to get the best performance.

    Of course my manager and my company disagrees with me, they just want more and more projects put in production as fast as possible, who cares about hard coding, as long as it works, that is fine. 🙁