Adding an Existing Visual Studio Project to Bit bucket

Hi Everyone, I have developed many utilities to automate things up for us in my local machines and I have lost a lot of them. We as a developer usually code develop our own utilities to increase our productivity and use our artistic mind and practice a lot of code in home, office, workshops etc.
We generally keep our repository in our local machines. But sometimes due to system failure, we lose our best works which no1 is aware or project you were working on. Usually, big organization uses a Source Control system to avoid this vandalism like SVN, TFS, Bit Bucket, GitHub etc. With the advent of GitHub and Bit bucket, it’s is easy for developers to keep his magic work to be saved in the cloud that to private to him. Continue reading

Choose and IIF Function in Sql Server

Choose function in SQL Server is used to get the item at the specified index from the list of available values. The index position starts with 1.

Syntax

Select choose(index,value1,value2,..)

1

If the mentioned index is greater or less than the specified values, It results null.

2

If we pass the float value in the index it will be converted to an integer, based on that the value will be selected.

3

IIF Function

If function returns the one of the two values, depending on the condition evaluates true or false.

Syntax


IIF(BOOLEAN CONDITION,TRUE_VALUE,FALSE_VALUE

The IIF function is like Ternary operator in a programming language with single condition.

4

Lead and Lag in SQL Server to check the subsequent and previous value of the column

The Lead and Lag functions returns subsequent row for the Lead() while previous row for the Lag function.

Syntax

Lead(Column, OFFSET ?(OPTIONAL),DEFAULT VALUE) OVER (ORDER BY CLAUSE)

LAG (Column, OFFSET ?(OPTIONAL),DEFAULT VALUE) OVER (ORDER BY CLAUSE)

Column :

      1. Column specifies the column value to be returned or expression to return.

OFFSET :

      1. The number of rows forward from the current row from the first row. Default value for offset is 1.

Default value:

    1. The default value is set if LEAD() returns NULL.

Here we have below mentioned table records which contains Project details and their respective Business Stakeholders.

1

So Now we want to see the next project that is needed to be done once the subsequent project gets completed.

So now i want to see my subsequent project with the use of LEAP() function as shown below:

1

Using LAG() to get the previous row from the column as shown below:

1

Setting default value to the LAG and LEAD() when functions returns NULL.

We have discussed OFFSET ?(OPTIONAL),DEFAULT VALUE) in syntax. The offset value defines the number of rows forward or back with LEAD() and LAG(). While Default defines the value when function returns NULL. So in order to handle the same we will set default value ‘NoProject’

1

Happy Learning

1