Monday, June 23, 2014

Things Google Staff Do

Monday, January 13, 2014


Have you ever tried to re- use a database and you need to purge its data, so that you maintain the database structures without its data for a test purpose on another server? Well, if that database is a real production system you will probably have some FK (foreign keys). Clearing a database of its data can be difficuralt with FK constraints. How do I mean? For example, if you run this syntax in the Query Analyzer:

TRUNCATE TABLE "table_name"

As you do this, you will somewhere run into an error saying you can't truncate a truncate a table because of a FK constraint. This is where the syntax below comes in. It will remove the constraints, truncate the tables, and place the constraints back.

use "Database_name"
SELECT 'USE [' + db_name() +']';
       '[' + + '].[' + + ']' +
       ' DROP CONSTRAINT [' + +']'
  FROM sys.foreign_keys f
 INNER JOIN sys.TABLES t ON f.parent_object_id=t.object_id
 INNER JOIN sys.schemas s ON t.schema_id=s.schema_id
 WHERE t.is_ms_shipped=0;
SELECT 'TRUNCATE TABLE ' + '[' + + '].[' + + ']'      
 INNER JOIN sys.schemas s ON t.schema_id=s.schema_id
 WHERE t.is_ms_shipped=0;
       '[' + + '].[' + + ']' +
       ' ADD CONSTRAINT [' + + ']' +
       ' FOREIGN KEY (' +        
       Stuff( (SELECT ', ['+col_name(fk.parent_object_id, fk.parent_column_id) +']'
                 FROM sys.foreign_key_columns fk
                WHERE constraint_object_id = f.object_id 
                ORDER BY constraint_column_id
                  FOR XML Path('')
            ), 1,2,'') + ')' +
       ' REFERENCES [' + 
       object_schema_name(f.referenced_object_id)+'].['+object_name(f.referenced_object_id) + '] (' +
       Stuff((SELECT ', ['+col_name(fc.referenced_object_id, fc.referenced_column_id)+']' 
                FROM sys.foreign_key_columns fc
               WHERE constraint_object_id = f.object_id 
               ORDER BY constraint_column_id
                 FOR XML Path('')),
              1,2,'') +
        ')' + 
        ' ON DELETE ' + REPLACE(f.delete_referential_action_desc, '_', ' ')  +
        ' ON UPDATE ' + REPLACE(f.update_referential_action_desc , '_', ' ') COLLATE database_default 
  FROM sys.foreign_keys f
 INNER JOIN sys.TABLES t ON f.parent_object_id=t.object_id
 INNER JOIN sys.schemas s ON t.schema_id=s.schema_id
 WHERE t.is_ms_shipped=0;

And when you are done, don't forget to shrink the logfile size of the database you just truncated. Use below syntax.


Sunday, October 27, 2013


A couple of years ago when I first
heard about the PMP, which is an
acronym for Project Management
Professional, I immediately pictured in my mind a top-brass executive, wearing an expensive suit and probably gold-rimmed spectacles, making key business decisions and whose life eventually ends up in some kind of financial mismanagement scandal.

Well, I discovered the real thing
wasn’t so far from my imagination,
especially if that person wound up
as an “accidental” project manager,
because the real ones have, and
follow, an ethical code of conduct of high-fidelity. Project management happens at different levels and scales. It is a result-driven profession. As a practitioner, you will have demonstrated over time that you
possess the knowledge, experience and skills to bring any project to a successful completion. Project Management in the 21 century is now a two-edged sword; it is a skill-set and, at the same time, a career path.
To read the complete article, visit

Monday, September 23, 2013


At the beginning of every year,
people across the globe make
resolutions on what to achieve, or
what to do better, or what they want
to quit doing. It’s called the New
Year resolution. This is the year
2013, a time when technology is
crossing boundaries and innovations
meet possibilities, a year when
Microsoft is consolidating on its
cloud offerings with emerging new
certification trends. How do you
shape up for the challenges of this
year? I want to show you a series of
paths you can take to ensure that
you remain relevant as a technology
specialist and solution provider.
I am going to discuss your options,
categorized depending on where
you’re at, so you can make the
appropriate decision:
1. First-level technology entrants – the
very basic career options and
certification paths.
2. Mid-level technology professionals –
how to move up the career and
certification paths available.
3. Senior-level technology professionals
– how to upgrade your current
certifications to the new on-premise
and cloud-based standards.

If you are absolutely new and you
want to make a career in IT, I
welcome you to the new exciting
world of Microsoft offerings. I
recommend you take a shot at the
Microsoft Technology Associate (MTA)
certification. The first good news
here is that the MTA does not expire
and it is a single examination
course. The beauty of this is that it
exposes you to infrastructure,
database design or software
development; it is not combined, so
you have to choose your area of
interest, and that is dependent on
your career goals.

Thursday, January 24, 2013

Help! I can't create a Site Collection without getting "Access Denied" errors!

Help! I can't create a Site Collection without getting "Access Denied" errors! by Susan Lanigan at her BLOG

Another one of those problems which is a short post but which took me hours upon hours to fix.
The error is as follows:

You log into SharePoint Central Admin with the intent of creating a site collection.
You go to Applications and do the necessary, ensuring it is added to the correct Web Application yada yada yada.
And then you go to the new link for your site collection - because you want to create some sites in it, naturally enough.

Access Denied Error!

Butbutbut - I'm the Farm Administrator! How can this be? How can I not see my own damn site collections?

By the time I had found the solution, via the good offices of google, I was quite ready to be the Funny Farm Administrator. But never mind. I know now what it is.

1. Central Admin. Attempt to access SharedServices1 page. Chances are you will get an Access Denied error

2. Application Management - Policy for Web Application. Is your farm account listed there with Full Control? If not, add it for the relevant Web Application (you'll see the web app filter in the view dropdown on the top right)

3. Still having problem? Go to Operations - Service Accounts. BE VERY CAREFUL ABOUT DOING THIS ON A PRODUCTION SERVER, HAVE A BACKUP FIRST:
Click "Web application pool" option button
Select Web Service - Winds SharePoint Services Web Application
Select Application Pool - usually only Sharepoint - 80 available. That's fine.
Select "Configurable" radio button and enter farm admin account user and password
Click OK
A lot of the links in SharedServices will still be broken but you will be able to view SharedServices1 and more importantly your site collections!

ps: Thanks a lot Susan. This came timely.

Thursday, December 6, 2012

Error Failed to Connect to the Configuration Database: An Exception of Type System.ArgumentNullException Was Thrown. Additional Exception Information: Value Cannot Be Null Parameter Name: Service.

So, here we are trying to expand the SharePoint 2010 farm a bit. The farm is comprised of one or more VM sitting in an elaborate VMware infrastructure and a few physical servers hosting the databases. So the VM hosting the application services for SharePoint 2010 is kinda slow, so, decided to add a new one and yank the slow one out, or perhaps even leave both of them in there, y'know how cool it is for us to have more servers doing stuff, good for my ego.

And after going through the harrowing experience of missing locally and missing in xxxx servers and yyyy servers, and other annoying language pack issues, the box was finally ready. So, I fired up the SharePoint 2010 Products Configuration Wizard of Oz, and got this along the way, just the very first steps really:

error failed to connect to the configuration database: an exception of type system.argumentnullexception was thrown. additional exception information: value cannot be null parameter name: service.

Familiar it seems. Of course the error is not familiar, but getting errors from SharePoint is like our thing. I mean if you don't get any you begin to wonder am I doing things right? Kidding.

So, how do we resolve this?
Create an alias on the server for the SQL client. For some reason this was just the solution.
And to do that:

SQL Alias is something which you may have to create when you’re moving your database server. I had a requirement to move from an old database server to new one  and as a part of the migration had to create SQL Alias. This is how you create it.

You will have to create SQL Alias on each web front and application server of SharePoint.

Click on Start > Run and Type cliconfg
Click on Ok
Now enable TCP/IP Protocol.
Select TCP/IP and Click on Enable

Click on Alias Tab
Click on Add
Select TCP/IP from Network Libraries
And enter the old database server name in Server Alias
And set the Server Name to New Database Server Name
Click Ok

An Exception of Type System.Reflection.TargetInvocationException was Thrown

From the stables of SharePoint 2007 error-laden blockbuster features, comes another mysterious and annoying error, *drum roll*special effects*camera upclose*camera drawback*more Star War effects*

An exception of type System.Reflection.TargetInvocationException was thrown. Additional exception information: Exception has been thrown by the target of an invocation.

Sounds like something from FRINGE.
This happens when you try to join a new server to a farm. And that is after you have battled the infamous installcheck which returned like 80 language packs problem, 120+ missing locally problem and the rest of the evil minions from SharePain hell.

So, what do we do? How do we resolve?

You won't believe this. It's your NTFS drive letter causing this. Crazy!
Just to be sure, open your ULS log file in the APPLICATION server and do a search for directory name you entered is invalid.

If this returns a series of results (best if you use Notepad++) then that is the problem. What to do is take a look at the drive letter convention in your machines, and ensure your new server is consistent with the drive letters. So, if your APPLICATION server has C, D, E, F drives, ensure your new machine is named the same way. When done, re-run the Configuration Wizard again, and you should be fine.