Category: Rant

What Happened At SoCal Code Camp And The Best Session I Attended!

Woohoo! That was a great Code Camp. Thanks to Woody and the gang for making this event happen. It was a fun and knowledge-filled event. I even got swags (a few books, a shirt, a small bag and a gym cup from Avanade). I saw a few Filipino devs in the event (Marlo, a .NET Developer from Long Beach and Marlon Ribunal) which was fun because I was used to being the only Filipino in the crowd (Yup, Woody can confirm that :P). I saw two other guys but I wasn’t able to approach them (because i’m shy :P). Next time I’ll take the chance to communicate with them and probably sway them to join DevPinoy. All in all there was 6 Filipino Devs in the event (that’s me and my wife, marlo, marlon and the two other Filipino guys) that I was able to count.


Ok, time for best session in SoCal Code Camp award.


The best session that I attended was the session of Scott Hodson, president of Ubero called “Programmer to CEO: Starting your own software business“. It talks about how you can start your own business, the processes that you need to go through to have one, the mindset that you should have when you are thinking of starting your own business, the people you need to communicate with in order to get the funds you need (VCs and Angel Investors) and the pain that you will go through while trying to make all the parts of your business move.


I was really impressed with the amount of knowledge that Scott provided to us in his talk and it opened my eyes on how I continue my dream of building a world-class Filipino owned outsourcing company. I do consulting on the side when I have the time and have outsourced projects to Manila in the past. I have people I trust with certain types of projects but never had the ability to consolidate this resources into one great enterprise. I know I could but I don’t have the funds yet to start building this dream. Probably in a year or two I can make abigger push to make it happen but in the meantime I have decided on focusing on building applications that I can market to generate funds (which i need to revisit). I have a couple of ideas here and there but after listening to Scott I realized that I need to go back to the drawingboard and start analyzing my goals, resources and ideas. Man, what an eyeopener. His presentation should be available to download in a few days so don’t forget to go and checkout the SoCal Code Camp site to get this presentation.


That was fun! The next one would be at UC San Diego this June and I’m going to be there again. I hope this time we can sway Jon Galloway, Ben Sheirman , Scott Koon and other great speakers to talk in San Diego.

How To: List databases in a SQL Server using T-SQL and truncate their logs

Finally i’m back after a month of crazyness due to my webhost not performing up to its promise of 99.9% uptime.


Enough with the rant and on with the article, today i’m going to talk about how to list databases in a SQL Server by just using T-SQL and then showing you how to truncate the logs on those databases in different ways.


First, let’s look at the 5 different approaches that you can use to list down databases in SQL Server by just using plain old T-SQL.


The stored procedure approach ( sp_databases, sp_helpdb ) :



The sys tables approach ( sys.databases, sys.sysdatabases ):



The using the undocumented stored procedure sp_MsForEachDatabase approach



Simple huh? Now that we know how to list databases let’s go back to the problem of truncating all of them in one query (in fact it’s just one line!). Some people would suggest writing cursors that would loop thru all the rows returned by our sysdatabases query to do this task. Their solution might be similar to the one listed below:


[SOLUTION 1]



Others would suggest a more primitive approach which is building a simple query first that would list the names of the database appended with the DBCC SHRINKDATABASE command:


[SOLUTION 2]



Then they would change the output option of the query into “Results to Text”, copy the result to a new query window and execute the query from there. Pretty primitive. Alot of steps. Same results.


My suggested solution is using the sp_MSForEachDatabase procedure in conjunction with the DBCC SHRINKDATABASE function. This would result into a 1 line query. Less code with less steps to do that creates the same results.


[MY RECOMMENDED SOLUTION]



Simple and straight to the point.


I hope you learned something from our article today. You can also do this programmatically by using C# and VB.NET. I wrote two articles about that topic here and here. Interested in truncating tables using sp_MsForEachTable? You can checkout this post.


Thanks!


 

My webhost frustration

I’ve been hosting with IPower for 3 years now and man i’m getting really really really really really frustrated with their hosting!


2 years ago I had the same experience with them and it drove me crazy to the point that I was already shouting at their technical support agent. Imagine hearing this words “we don’t have any backup of your site” in a time when you are getting really mad. Intense huh? Eventually my site was restored because “they actually” have a backup system in place.


But this week is a different story.


 My site went down last monday due to an unknown error. At first i thought it was the server migration that is currently happening with my host so called them up to ask. What happened next is that i ended up being in the phobe queue for 4 hours. When I finally got my chance, I immediately asked the tech support agent about whats going on and why their lines are busy all day. He told that its been a busy day and that they are getting tons of support calls because they are experiencing a server outrage. 


He said that there are currently 48 other people waiting to get their call to be answered. That means alot of people are getting their blood raised to their head because of anger and frustration.


We did some troubleshooting that day but to no avail they can’t figure out whats wrong so my site ended up down for 4 days.


Miraculously, my site went up today but with one noticeable difference… it’s really slow. The load time of the site is oddly slower than what it was the last time it was working. I guess there is some other things thats not perfectly in place yet. I’ll monitor it for now and probably send another support ticket if this slowness continues.


Oh well, i have enough ranting for a day. I hope everything goes well from now on because I can’t take downtimes like this anymore. I’ll stick with this guys for the rest of the year and we’ll see how it goes from there.