How to find the number of records in a table without using COUNT() function?

It is possible by using MAX value of ROW_NUMBER() in a table and from Rows column of sysindexes. ————————————————————————————— USE [ADVENTUREWORKS2012] GO ————————————————————————————— — Finding Row Count using Max function. -– Returns 19614 ————————————————————————————— SELECT MAX(Rnum) AS [Row_Count] FROM ( SELECT ROW_NUMBER()

Read More

Arithmetic Operators

Arithmetic operators perform mathematical operations on two or more than two expressions with same datatypes. These Operators are same as arithmetic operators in other programming languages. Arithmetic operators supports numeric datatypes like Tinyint, Smallint, Int, Bigint, Decimal, Float…The datatype of the result

Read More

What’s the maximum size of a row in SQL Server?

8060 bytes.

Read More

Operators

Operators are the symbols to perform an action for the given expressions. The following are the list of operators available in SQL Server. Arithmetic operators Assignment operator Comparison operators Logical operators String concatenation operator Bitwise operators Unary operators Operator Precedence: When a

Read More

What are SQL aggregate functions and explain few aggregate functions which you have used real time?

SQL Aggregate functions are the functions which perform calculations on the group of data and returns a single value. Except COUNT() function, all other aggregate functions ignore NULL values. When we are using aggregate functions in SELECT list, it is mandatory to

Read More

Why do we set ANSI_NULLS ON before writing a script?

ANSI_NULLS property is used for comparing ANSI NULLS. By default it is ON in SQL Server. As all of us aware that, we cannot compare a NULL with another NULL. i.e. We can not equal a NULL with another NULL or not

Read More