Data Haunting

Easy Solutions Destination

By

Sql server check if column exists in table

In Sql server if we want to be sure that specific column exists in given database table or not than you can check either manually or using query for large number of columns of table. In this tutorial we will see how to check if column exist in database table.

By

Insert Multiple Rows in a single query in Sql Server

Recently I have faced this question in interview that how to add or insert multiple rows in a single query at once. So I have find out two different solutions for this query. Let’s see the solutions.

By

How to find Host name, Server name, User name and DataBase name in Sql server

Frequently in interview we face the question that how to get Host name(machine name), Server name, User name and DataBase name of Sql Server which are connected in Networks. In this article we will see that how to find Host name(machine name), Server name, User name and DataBase name using Sql select query in Sql Server management studio which is quite easy.

By

Find nth highest and lowest salary of an Employee

This question has been asked many times in interview to candidate that find or fetch nth highest and lowest salary of an Employee like 2nd, 3rd, 4th, 5th… highest and lowest salary of an Employee from Employee table. This question some times also asked as get nth highest and lowest salary of an Employee without using TOP and sub query. Let’s see solutions for all this questions in this article.

By

Difference between Primary Key and Unique Key in Sql Server

In Sql server Primary key and Unique Key seems identical as both identify a unique and distinct record in the database, but Primary Key and Unique Key both are different in it’s Features and behavior so logical implementation is also different . In this article we will compare Primary Key and Unique Key.

By

Difference between Stored Procedure and Function in Sql Server

Sql Server’s two Objects Procedure and Function seems almost same as both we used to write the query but there is huge difference between procedure and Function as per concept and logically use of both it . We will see Stored procedure (SP) VS User Defined Functions.

By

Procedure or function expects parameter which was not supplied

We have seen this error number of  times that is “Procedure or function expects parameter which was not supplied”  in Asp.net c# and sql server . Every time reason for this error is different . Today here I will explain different reasons for this most common error.

By

How to find table which is used in many stored procedures

Sometimes in sql server when we change in table column or schema it is very hard or difficult to find that given table is used in how many procedure because  some time it is necessary to find and make changes in most of stored procedure related to that particular table . So i find easiest way to find all stored procedure  by using following Sql query  in Sql Server 2012.