SQL Server indexes are used by queries to find data values quickly in tables and views. Basically it speed up the queries performance. You can also relate a SQL Server Indexes with any text book…
SQL NULLIF expression compares two expression and returns a null value if the two specified expressions are equal, else it returns the first expression. NULLIF expression is equivalent to a searched CASE expression in which…
SQL STATISTICS IO is a set statement , when it is enabled it causes SQL Server to display information about the amount of disk activity generated by T- SQL statement. SYTANX SET STATISTICS IO {…
The IS NULL is used in SQL to find a NULL value. It returns TRUE if a NULL value is found, otherwise it returns FALSE. SYNTAX SELECT col1, col2, .. FROM Table WHERE Expression IS…
The IS NOT NULL is used in SQL to find a non-NULL value. It returns TRUE if a non-NULL value is found, otherwise it returns FALSE. SYNTAX SELECT col1, col2, .. FROM Table WHERE Expression…
Sometimes, you need to store multi language or multilingual data in any table column. Inserting a multilingual data into column without following some basics rules, you see that when you select data from table, it…
SQL RAND function is a mathematical function which returns a pseudo-random float value from 0 through 1, exclusive or a random value within any range. It can also take an optional seed parameter which is…
SQL delete statement is used to delete records from table based on specific conditions which are specified in where clause. Delete statement can also be used as Delete TOP, which also allows you to use…
When you are required to import data received from different different file format such as .txt, .csv., or excel files, sometimes you see a white spaces along with the data, which may create a problem…
Sometimes you need to format a date in specific format such as format a date time string YYYY-MM-DD hh:mm:ss. mmm to date MM:DD:YY. SQL Server provides you a various options that you can use to…
Sometime you are required to validate the row counts for each tables in database. So getting a row counts for each tables either through using a loop on each table or go and get row…
Object_ID is a SQL Server Metadata function which returns the database object identification number of a schema-scoped object. It can not be used for object that are not schema-scoped such as DDL triggers. If any…
Dynamic data masking also known as DDM is a security feature in SQL Server which helps you to prevent the access of unauthorize users to sensitive data in the database. It was introduced in SQL…
Collations in SQL Server provide sorting rules, case, and accent sensitivity properties for your data. You can easily find SQL collation at the server, database and column level using SQL Server System Catalog views, or…
PARSENAME function is a SQL Server Metadata function which returns the specified part of an object name. The parts of an object that can be retrieved are the object name, schema name, database name, and…
SQL SELECT TOP statement is used to retrieve records from tables and limit the number of rows or percentage of rows returned based on a specified value. It is also known as TOP Clause or…
If any number that is written like as 1st, 2nd, 3rd and so on.. is called an ordinal number, and it is read as 1st( first), 2nd(second), 3rd(third), 4th fourth respectively. By adding a letter…
There are various in-built system catalog views, or metadata functions that you can use to check the existence of column in SQL Server tables. To demonstrate this, first we create a table in SQL Server…
Lets see how to print a Xmas or Christmas Tree in SQL Server. The best way of implementing a Xmas tree pattern you can use a Recursive CTE, as shown in below T-SQL. Note that: After…
SQL code snippet is a template which contains the basic structure of a Transact-SQL statement or block, so that you can quickly write queries without any syntax errors. It was released in SQL Server 2012…