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.
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.
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.
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.
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.
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.
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.
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.