Entries Categorized as 'Programming'

Generate series using T-SQL

Date February 26, 2010

It is common developer requirement to get missing records from series. For that they generate temporary table and insert complete list of numbers and then find missing numbers using LEFT JOIN. In SQL Server 2005 and 2008, new keyword “WITH” introduced that works with SELECT, INSERT and UPDATE statement that use to create temporary resultset [...]

Count Number of Words in a Sentence using ASP

Date October 16, 2009

There is no function in ASP to count number of words in sentence or long string. Bellow is very simple function that count number of words and return that count.

< %
Function CountWords (StrValue)
Dim iWords, mLengthWithSpaces, mLengthWithoutSpaces

‘ following line calculate the actual length of string
mLengthWithSpaces = Len(StrValue)

‘ following [...]

String.Trim() in Javascript

Date September 1, 2009

Trim is a useful String function available in languages like Visual Basic, Java & PHP which removes all leading and traling whitespaces from a String. Unfortunately Javascript does not provide Trim functionality to the String object. But there is solution using Regular Expression. Use following code in top of your Javascript file. Following code will [...]

SQL Server Date Formats

Date June 4, 2009

One of the most frequently asked questions in SQL Server forums is how to format a datetime value or column into a specific date format.  Here’s a summary of the different date formats that come standard in SQL Server as part of the CONVERT function.  Following the standard date formats are some extended date formats [...]

Subscribe to Technology Tips

Subscribe to Saqib-Ansari via RSS

Or, subscribe via email: