Monthly Archives: November 2015

Starting a company – learning by trial and error

A friend recently asked me how I decided to start my own company, was it something I always wanted or did it happen by chance, how did I make it happen? While I don’t claim to know anything about how to start a company or even be good at it I figured I should still jot this down before I forget. Frankly, I see myself as the Forest Gump of startups, stumbling upon good fortune rather than actively chasing it. Here are some of my takeaways from the first 3 years.

Stop thinking and start doing

I had the thought in my head for many years before I actually set out. From early on in my career, colleagues had suggested I start a consulting firm of my own, I mostly treated it like friendly banter than sincere advice. I obviously felt I was too young or not good enough to actually make it on my own. But once I started my company I realized I was ready at least 3 years earlier. The more I thought about it the more it made sense to fail early in my life so that I have time to make up for it should things go wrong.

Where is your support system?

We live in a time of amazing tech where you can automate almost anything and it’s possible to be a one man show when your start out, but machines can’t provide you a reality check and advice once you start making hasty decisions. Always have another partner to help temper enthusiasm with reality. If your partner is your spouse (as is the case most times) lay some ground rules and try hard to keep personal and professional relationships separate.

Have a plan

Start out and as soon as you get some time, make a plan for where you want to be at the end of every quarter and every year. It’s important to start this journey with milestones and a destination, I have been measuring mine and my company’s success based on a PPT for the last 3 years and each time we were able to correct our course midway because we constantly use it as a frame of reference.

Expect failure

It’s very rare for a startup to succeed on its first attempt, expect that there will be problems and find a way to stay positive. One of the biggest strengths of a startup is its tremendous energy, try and stay tapped into it. Every once in a while you get bad news and it’s easy to lose track of everything that has been achieved already.

It is going to be tough

Be prepared to put in hours and months of effort. During the first year I worked 7 days a week for almost 14 hours a day everyday (I still do sometimes). Naturally it took a toll on my health and my personal life but it has helped me get where I am today. I have friends who occasionally want to try their hand at consulting and the first thing I do is tell them to join me for month, I ask them not to quit their day job but instead take on additional work from my firm as well, most guys give up by the first week saying it’s too much of an effort, if you can’t commit an additional 4 extra hours per day you’re not ready.

Both feet in

Running a company is not something you can do along with a day job. Most guy’s think of it as freelancing, it’s not. You have to wholly commit to your company. Heck if the founders are not interested then how can you expect anybody else to be?

It’s not just one skill

Being a good techie or people manager is not enough to start a company , it requires people skills , technical skills and financial skills as well as a number of other skills , if you don’t have it hire someone who does , but don’t assume you can be it all or that you can manage without a few of them.

Track the money

Always keep a good eye on the money, it is what drives the company. Know how much you have and where it’s all going, pay your taxes and make sure you understand the pulse of your company. I initially didn’t pay much attention to this aspect but once I started doing some BI on my financial reports I was able to save money from efficient processes as well as divert funds to projects that were more promising.

Measure success

Set a goal, don’t think of your company as a never ending entity but define the goals for it. Something like “I am starting a company because I want to live in a big fancy house and see the world by the time I am 30” In startup parlance it’s called an exit, the point at which you feel you have got what you wanted from the company and are willing to sell it off or hand it over. Measure how your company is helping you realize that goal.

Look the part

It might seem silly but it does have a big impact, while working, I often asked my managers what my jeans had to do with my coding skills but now I understand the difference. If you’re working in a creative outfit sure jeans make sense but in software development especially the CEO needs to look the part romanticizing the young CEO with rolled up sleeves and jeans only looks good in the movies. If you want to be treated like a leader then you need to look like one too (unless you’re Gandhi).

Your Team

VC’s cite the team as one of the biggest decision factors when trying to identify good companies and it’s true. A good team can help run the company smoother, better and easier. But as the CEO you need to learn to trust your team. Understand that you are part of the company and not the other way round.

People are good

Believe that people are good because they almost always are. Nobody wakes up in the morning thinking how I can betray someone’s trust today. Clients might be late but the payment will come through be patient and don’t burn bridges until you have exhausted all other options.

Know your worth

When starting out I had a choice to make, bids for projects as the lowest rate or stick to my guns and charge a fair price. I stuck to my guns and was rewarded when clients who initially started with the lowest bidder later came back after losing precious time and money and still not getting what they asked for. These clients are today my regular customers who always think of me when they face a problem and need help.

Put yourself in your clients shoes

If you were the client would you be happy with the service you just provided? Be your clients’ biggest advocate.

Attaching a database mdf file when the ldf file is missing – with a catch!!

A few days back I got a call close to midnight where a client’s client was facing an issue. They had recently suffered a power failure and the Sysadmin while bringing the database server online deleted the ldf file for the database by mistake. I can only assume he thought log file meant error logs or something. But unlike most examples we see where you are advised to use

One of the three below options

In this case we couldn’t since there were active transactions running on the server when the power failure happened and as a result the database mdf file was not consistent. The error we kept getting was

The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only.

Which made sense, now the problem was how we get the database back online, naturally they didn’t have any backups. A quick google search took me to this awesome article. If you are a DBA I strongly recommend you take 10 minutes out to read the article properly since it can save you a world of pain someday.

The basic steps are outlined below

  • Create another database with the same name.
  • Take the database offline with rollback immediate –this is a very important step.

alter database corrupt set offline with rollback immediate

  • Copy past the corrupt mdf file over to the location where the offline database mdf and ldf files are present and run the alter database modify file command shown below.

  • When you try to bring the database online you will get an error but that’s OK.

alter database corrupt set online

  • Fix the corrupt database by running DBCC checkDB and repair_allow_data_loss, this will clear out the inconsistent data. 

And with this the database is up and running.

The Dunning – Kruger effect

If you don’t know what this means pay attention!! I recently posted a blog about the characteristics of a senior DBA. One of the points mentioned there was how Senior DBA are often left with a feeling that they have only scratched the surface. At the time I didn’t know this was a scientifically proven fact. The Dunning – Kruger effect is essentially a study conducted to understand the effects of skill on confidence.

The findings are

    Unskilled people are often over estimating their competence because they are so unskilled they don’t realize they are unskilled

    Highly skilled people are often under estimating their competence because they feel that what is easy for them should be easy for others too.

I have encountered this bias many times before without knowing the correct term for it. I have seen it in interviews where the interviewee overpowers the first interviewer with sheer confidence only to fail miserably in the next round when things get really technical. Also I have seen this happen in review meetings where solutions are being thrown around that make absolutely no sense.

Occasionally during my trainings I encounter a person who feels they know the technology a lot better than they actually do. In these cases I normally take the below approach

Me:- Ok, so why do you think that is?

Followed by

Me:- Ok, so for a moment let’s assume you’re right, then how would you explain this ………?

The answer to the above lets me know who I am dealing with. I have been using the same approach for many years now when it comes to interviews as well. The good thing is most often they understand things were not as they thought and appreciate the clarification but not always. When it comes to senior folks I have seen they tend to over analyze a simple question often resulting in a feeling that they are themselves not sure if their answers are correct, this has to do with the 4 stages of competence. These are the guys who fall into the green part of the triangle.

 

 

Then there are the guys in the Blue part of the triangle, the guys who immediately start taking action based on their previous experience. They don’t just know what the different reasons for an issue are they also know the likelihood of these issues happening in the real world and have a tried and tested approach to fix them. I would like to think I am in the green part of the triangle. The reason for this post is for the longest time I underestimated my skills as a DBA. Now that I am running my own company, I have realized I could have started sooner. I felt I should share this with everyone because it’s very important that we evaluate our skills honestly rather than wait for someone else to do it for us during an annual appraisal cycle.

A ton of MS E-books to download

I am not sure how many other users have visited this blog but it’s been one of my go to places when I wanted to read up on a particular topic. Tons of e-books available to avid reader of IT literature.

http://blogs.msdn.com/b/mssmallbiz/archive/2015/07/07/i-m-giving-away-millions-of-free-microsoft-ebooks-again-including-windows-10-windows-8-1-windows-8-windows-7-office-2013-office-365-sharepoint-2013-dynamics-crm-powershell-exchange-server-lync-2013-system-center-azure-clo.aspx

Renaming all columns in a table quickly

Recently imported a table where the column names where quoted using double quotes which then became the table names , So a column name would be “Airline” instead of Airline. Here is a simple script to rename all the columns in all tables within a database.

SELECT
'['+TABLE_SCHEMA+']'+'.['+TABLE_NAME+'].['+COLUMN_NAME+']'
AS oldcolname,
REPLACE(COLUMN_NAME,
'"','' )
AS Newcolname INTO #store FROM
INFORMATION_SCHEMA.COLUMNs
 
ALTER TABLE #store
ADD id INT IDENTITY(1,1)
 
SELECT * FROM #store
 
DECLARE @id INT = 1
 
WHILE @id <= 260
 
BEGIN
 
DECLARE @tablename VARCHAR(1000) =( SELECT oldcolname FROM #store WHERE id =@id )
 
DECLARE @tablename1 VARCHAR(1000) =
( SELECT Newcolname FROM #store WHERE id =@id )
 
EXEC
SP_RENAME
@tablename, @tablename1,
'COLUMN'
 
SET @id = @id +1
 
END