The ‘Database’ Archives
Posted January 30, 2017 by

Logical Query Processing in SQL Server

feature-sql1-618x350

To learn the basics of SQL Server, you must have an understanding of how an SQL Server query engine executes an SQL query. T-SQL involves both logical and physical query processing. Physical query processing is about how a database engine processes a query. Logical query processing is a conceptual flow, an order of the clauses […]

Posted January 23, 2017 by

COALESCE and ISNULL Functions in SQL Server

feature-sql1-618x350

SQL Server has introduced multiple ways to handle NULL values. The functions that are most used to handle NULLs are COALESCE and ISNULL in SQL Server. These functions are used to find Non-NULL values from a list of arguments. In this post, we will see the uses of the ISNULL and COALESCE functions and their […]

Posted January 5, 2017 by

A Beginner’s Guide to Sequence Objects in SQL Server

database-admin

SQL Server has supported SEQUENCE objects since the inception of SQL Server 2012 and later editions. Oracle database has supported SEQUENCE objects from the beginning. You can read the archive post on Tech-Recipes using SEQUENCE in Oracle.

Posted December 20, 2016 by

SQL Server: Table Schema Documentation Using DB>Doc

feature-sql1-618x350

Every developer likes to work on a code that is thoroughly documented with documentation that makes sense and provides adequate insight and information to understand the code’s functionality. Most programming languages provide special tools to generate documentation. For example, the JavaDoc tool is used for generating API documentation in HTML format from available doc comments […]

Category Database, SQL Server

Posted November 27, 2016 by

Microsoft SQL Server: Estimated vs. Actual Execution Plans

SQL Server Estimated vs Actual Execution Plan

Let’s assume you are constructing a new house, and you have a contract with a builder. After thoughtful examination of the area, height, and materials needed, he estimates it will take 120 days to build a new home. After constructing the home, it actually took 200 days to built it. There is a difference between […]

Posted May 13, 2016 by

How to Keep Your Data Backups Safe

Data Backup

We have all heard the horror stories: You receive a late night call from the office, the caller frantically telling you that the entire network has gone down and the backups are corrupted, or even worse, missing entirely. The IT landscape is littered with tales of backups gone wrong, both deliberately and accidentally. Businesses have […]

Category Database, Networking

Posted February 25, 2016 by

Find an Object’s Creation and Modification Dates in SQL Server

feature-sql1-618x350

SQL Server is an all-in-one IDE for managing multiple user instances, SQL programming, and changing settings using graphical options. Often, we need to find out when a stored procedure/trigger was last modified, or we need to find the creation date of existing objects in SQL server. Finding the creation dates and the modification dates of […]

Posted February 11, 2016 by

SQL Server Three-Valued Logic and NOT IN clause with NULL values

feature-sql1-618x350

While querying the production server to solve one critical issue, suddenly one query completely caught my attention. We had written a query which was created to find records which exist in Table A but do not exist in Table B, based on a certain column. The query was syntactically correct and ran without any errors, […]

Posted February 11, 2016 by

How to Find Nth/Second Highest and Lowest Salary in SQL

feature-sql1-618x350

Based on what I have heard from friends and other online users and from my own personal experience, the most common job interview question for database programmers is “How do you find the highest salary in an employee table?” This question tests a candidate’s knowledge of ranking functions, subqueries, common table expression (CTE) and basic […]

Posted February 9, 2016 by

Beginners Guide to CHECK Constraints in SQL Server

database-admin

During my schooling, one of my teachers said, “A friend of mine scored 105 on a science test out of 100. I was wondering how it is possible to score 105 out of 100. In this case, the value was inflated. Later, it was revealed that the score was a miscalculation. His score was 97. […]