Saturday, March 30, 2013

Beginning Task Date Does Not Move in Project

I don't know if you use Microsoft Project as I do, but I have seen many times the case I'll describe next.

Imagine that you have this simple project schedule where all tasks depend each other.

Then, you realize that the subtask 2 is going to last 5 days indeed, so you make this fix and hope the task 3 to begin just when subtask 2 finishes. However, when you do this change the beginning date of task 3 doesn't move, only the final date moves, highlighting new dates.

Don't worry, it's not that your project has broken or something like that, the little detail here is that, although you have your tasks set to be automatically programmed, all tasks won't move its dates if there're progress recorded in them.

That's why if you want to have this date moved you must go to task details and clear any porcentage shown.

That's the way to do it, and you will see the task moving according to your changes.

So, you can now moving your dates as you wish, be careful with this because I have seen many project managers that use this trick to hide relays.

Friday, March 29, 2013

Executing SQL Script from Command Line

Yes, It's more pretty your SQL Server Management Studio, because you can just go to "File" option, find there "Open" and click on "File..." to load a SQL file (.sql) to execute it without problems.

But, have you ever tried to do so with a file create by this tool being large enough to freeze it literally when you open it? Well, in this case there's no way to execute that file through the tool.

Therefore, here we are with a SQL Server command that will help us with this task. You just have to keep in mind the command: sqlcmd, simple right?.

Let's say that we have a SQL server called "MY_SERVER" and my SQL instance "MY_INSTANCE" installed there. What I need now is to execute the following script "my_large_script.sql" located at "D:\Test".

It's important to consider that this command use Windows authentication by default, so it's only required to put this line in any command prompt:

sqlcmd -S MY_SERVER\MY_INSTANCE  -i D:\Test\my_large_script.sql

However, if you are using SQL authentication it's neccesary to use your credential in this way:

sqlcmd -S MY_SERVER\MY_INSTANCE  -U domain\my_user -P my_password -i D:\Test\my_large_script.sql

That's all, have fun with your scripts.