Yearly Archives: 2014

UPPER() function in SQL Server

UPPER():- This function is used to convert the value of a column to upper case.  Syntax:    SELECT UPPER(string) OR Select UPPER(Column name) from tablename For example,   SELECT UPPER(‘Vivek’) Result:    VIVEK

Posted in SQL Functions, SQL Server | Tagged | 30 Comments

LEN() function in SQL Server

LEN():- This function is used to get the length of the given string value.   Syntax:-     Select len (stringvalue)   For example,     Select len(‘Vivek Johari’)    Result:-    12

Posted in SQL Functions, SQL Server | Tagged | Leave a comment

LOWER() function in SQL Server

LOWER():- This function is used to convert the value of a column to lower case  Syntax:-  Select LOWER (string)    or    SELECT LOWER(column_name) FROM table_name For example, SELECT LOWER(‘Vivek Johari’) Result:- vivek johari

Posted in SQL Functions, SQL Server | Tagged | Leave a comment

LTRIM() function in SQL Server

LTRIM ():- This function is used to get the string after the removal of leading blank spaces. Syntax:- LTRIM ( character_expression ) For example:- Select LTRIM  (‘  Vivek Johari’) Result:- Vivek Johari (without blank spaces on left side)

Posted in SQL Functions, SQL Server | Tagged | 21 Comments

Substring() function in SQL Server

Substring():- This function is used to return the specified number (third argument “len”) of characters from a given string(first argument) from the start position as specified as the second argument. Syntax:-    Select  SUBSTRING ( expression ,start , length ) … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 31 Comments

Max() function in SQL Server

Max():- This function gives the maximum value of the selected column Syntax:- Select Max (col1) from table_name In this article, we are going to use the following table for the examples:- CREATE TABLE [dbo]. [Employee]( [Empid] [Int] IDENTITY (1, 1) … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 26 Comments

AND and OR Operator in Sql Server

And & Or:- These Operators are used to further filter the recordset return by SQL queries when more than one conditions are specified. In case of “AND” all the conditions must be true and in case of “OR” any of … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged | 31 Comments

RTRIM() function in SQL Server

RTRIM():-This function is used to get the string after the removal of all trailing blanks. Syntax:- RTRIM ( character_expression ) For example:- Select RTRIM(‘Vivek Johari  ‘) Result:- Vivek Johari (without blank spaces on Right side)

Posted in SQL Functions, SQL Server | Tagged | Leave a comment

SUM() function in SQL Server

Sum():- This function is used to get the sum of values of the specified numeric column.  Syntax:-  Select Sum (column_name) from tablename Example:- In this article, we are going to use the following table for the examples:- CREATE TABLE [dbo]. … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 31 Comments

Round() function in SQL Server

Round():-This function is used to round a numeric field to the number of decimals specified. Syntax:-     ROUND ( numeric_expression , length [ ,function ] numeric_expression :-Expression of the exact numeric or approximate numeric data type category, except for the … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 31 Comments