Understanding and Using PIVOT clause in SQL Server 2005

February 7, 2009 03:48 by akashheranjal
SQL Server 2005 has lots of new features, of which one is PIVOT clause. This is similar to Pivot tables in MS Excel and Matrix Control in Reporting Service. Here is a simple example demonstrating how to use PIVOT clause. I am right now taking a simple example. There are scenarios where there could be a need to write a big stored procedure to build a Pivot table in lower versions of SQL Server. [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

How to check a web form can have HTML/Script Injection?

January 10, 2009 00:14 by akashheranjal
Injection of HTML code and/or client side scripts like JavaScript, VBScript, and Jscript by malicious web users into the web pages viewed by other users is a computer security vulnerability typically found in web applications. This is popularly known as Cross Site Scripting (XSS) Attack. [More]

Currently rated 3.0 by 1 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Generating documentation from Visual Studio XML comments - Part 1

January 8, 2009 17:57 by Sandeep Chugh
Have you ever considered adding documentation to your code instead of maintaining a separate word document as part of your application high level and detailed design? Let me start this series with the basics of generating help documentation and I will describe the different XML tags available for documentation and how we can generate our design documents out of XML comments in later articles of the series. [More]

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Another way to export SQL Server table data to a Text file

January 1, 2009 21:01 by akashheranjal
No doubt that a DTS or SSIS package can be used to export SQL Server table data to a text file. The below article is to demonstrate another way to export SQL Server table data to a text file using xp_cmdshell extended stored procedure (This is with reference to SQL Server 2005 and above). [More]

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Converting Row Data as Comma Separated String

December 29, 2008 06:02 by akashheranjal
One of my office mate Ranjan Patra did some research on internet and found a simple and quick solution to have row data as comma separated string. [More]

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

How to select random rows from an SQL Table?

December 22, 2008 09:52 by akashheranjal
IN SQL Server, it is easy to select one random record or a sequence of random records from a database table. For example if you have requirement to pick a single quiz winner randomly from the database table or you are making an online test application and need to pick X number of questions randomly from the database table; you can certainly use the below SQL queries… [More]

Currently rated 4.0 by 2 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

How to eliminate duplicate records from a database table?

December 20, 2008 05:00 by akashheranjal
This is a general problem faced by a maintenance team. While importing or exporting data to or from or between databases, the PK is removed accidentally and the table now has lots of duplicate records. The big question for the support staff is how to clean the database? It's simple... [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5