• Doug Bishop (11/29/2010)


    Why, oh why, oh why, oh why do people still insist on using scripts? They do it here too and it is frustrating.

    Anyone ever hear about a new object in SQL Server called stored procedures?

    Not only that, but SQL Server also came out with something called the SQL Server AGent a while back (maybe not everyone is read up on it yet), and Jobs. The jobs have steps and you can control the order in which you execute stored procedures. If one fails, you can take specific action, including sending out email, paging someone, etc. It is really cool stuff. Besides, you do not need to learn hieroglyphics (@for /r %%s in (.) do (echo ..............%%s /b >>).

    Not only is it more efficient, using stored procedures allows SQL Server to compile the code and results in overall faster execution. And, if you need to insert something between *_A and *_B, just insert a job step, and all references in both upstream and downstream steps are automatically adjusted.

    Some people use a thing called version control for those stored procedure scripts, and although there are some flashy features in Visual Studio or third party tools to help maintain code and deploy them; some companies are either not in the position to do that; or just don't want to use them, especially when it can be done on the command line for no extra licence cost.

    Martin