Archive

Archive for February, 2013

.NET Training at NuWare, Bangalore, Jan 31st – Feb 24th, 2013

Finished with .NET training at NuWare, Bangalore….Awesome experience!!!

100_0365

 

Advertisements

IIF() Function in SQL Server 2012

Eventually, SQL Server offered the IIF() function. The IIF function means “Immediate IIF” and not “Inline IIF”, that’s how SQL Server defines it. Doesn’t matter as long as we have it in T-SQL. Now, we can avoid using complicated CASE statement.

IIF function accepts three parameters. First parameter is an expression, which returns True or False. If it returns True, the second parameter value is returned else for False, the third parameter value is returned.

IIF

Of course, we can use nested IIF as well.

 

NestedIIF

New T-SQL Functions in SQL Server 2012

SQL Server 2012 has provided us with those T-SQL functions such as IIF(), CONCAT(), PARSE(), etc., which we have always been looking for in earlier versions of the SQL Server as these are out there in other programming languages and we often use them.

Here goes a list of all new T-SQL functions in SQL Server 2012:

1. New Analytic Functions

  • FIRST_VALUE
  • LAST_VALUE
  • LAG
  • LEAD
  • PERCENT_RANK
  • CUME_DIST
  • PERCENTILE_CONT
  • PERCENTILE_DISC

Read more…

How to Attach AdventureWorks2012.mdf File without .ldf File

I downloaded AdventureWorks2012.mdf file from http://msftdbprodsamples.codeplex.com/releases/view/55330 and tried to attach it into the SQL Server Management Studio, the process showed up with below error:

AW2012_Error

Read more…