Currently browsing

October 2012

SQL 2012 FORMAT for Date formatting

SQL 2012 FORMAT for Date formatting In SQL Server 2008 and earlier version used the CONVERT() function to handle the date formatting. As we notice that the function is not very user friendly. In SQL Server 2012, a new function named FORMAT() has been introduced which is much easier to …

WITH ROLLUP

WITH ROLLUP ROLLUP operator is used to generate subtotals and totals. The ROLLUP generates a result set that shows aggregate for a hierarchy of values in the selected columns. Without going in the theoretical details we are going to an example to understand the power of ROLLUP operators. Step-1 [ …

Drawing an Ellipse with Mid Point Ellipse Algorithm in CC

Drawing an Ellipse with Mid Point Ellipse Algorithm in C/C++ The theory for drawing Ellipse with Mid Point Algorithm is same as that of Circle drawing. But the difference is that the Ellipse is divided into two regions because it has two radii. The regions are separated from each other …

Dropping Constraint

Dropping Constraint Sometimes it is necessary to drop all the primary key, foreign key or unique constraint from a specified table. Here is this article I am preparing a T-SQL stored procedure to clean the constraint according to your needs. It takes Database name, table name, constraint name and Type …

Drawing a Circle with Mid Point Circle Algorithm in CC

Drawing a Circle with Mid – Point Circle Algorithm in C/C++ As in the previous line drawing algorithm, we sample at unit intervals and determine the closest pixel position to the specified circle path at each step. For a given radius r and screen center position (xc, yc), we can …

Ranking Function

Ranking Function Ranking functions return a ranking value for each row in a partition. Depending on the function that is used, some rows might receive the same value as other rows. Ranking functions are nondeterministic and return Big Integer values.   This article is related to RANKING Function. ROW_NUMBER function The …

How to do Texture Mapping in OpenGL A sample example

How to do Texture Mapping in OpenGL?? – A sample example. Texture mapping is the process of applying colors from an image to an object created in OpenGL. A simple example would be, applying a brick image onto a square which makes the square look like an original wall. OpenGL …

Interview Question and Answer

Interview Question and Answer [ New Question Added on Date: 08-MAY-2012 ] All of my readers are invited to SQL server Interview Question and Answer. Please look at the new section and make your comments on it.  You can find the link from my web “SQL Knowledge Bank” [Upper right …

STUFF Function

STUFF Function    In this article I am trying to illustrate a vary useful function of SQL Server called STUFF. STUFF Function Stuff is a T-SQL Function used to delete a specified length of characters within a string and replace with another set of characters.    Syntax: STUFF(Character_expression1, start, length, …

Implementing Bresenhams Line Drawing Algorithm in CC

Implementing Bresenham’s Line Drawing Algorithm in C/C++ Bresenham’s Line Drawing Algorithm is an accurate and efficient raster line-generating algorithm developed by Bresenham. In this algorithm, we first consider the scan – conversion process for lines with positive slope less than 1. Pixel positions along a line path are then determined …

CURSOR Type

CURSOR Type Sometimes it is necessary to use the cursor, as we know that the cursor is a big performance killer and we always avoid it. But we can save some performance degradation if we know the type of cursor very well. This article illustrates the cursor type used in …

Drawing Straight Line using DDA Algorithm in CC

Drawing Straight Line using DDA Algorithm in C/C++ The digital differentia analyzer (DDA) is a scan-conversion line algorithm. In this algorithm, we sample the line at unit intervals in one coordinate and determine corresponding integer values nearest the line path of the other coordinate and plot those coordinate (pixel) in …

Alteration of CURSOR

Alteration of CURSOR As we all know that the cursor is a bad performer. We always try to avoid cursor. So the question is how we avoided the cursor? This article give us the demonstration, how to avoid the cursor.  In this example i am trying to make a stored …