Category Archives: SQL Basic Concepts

SQL Basic Concepts

How to rename a Table in Sql Server

To rename a column in a SQL Table following command can be reused: SP_RENAME  ‘old table name’, ‘New table name’ For example, if we want to rename the table from employee to employeemaster, following command can be used. SP_RENAME  ’employee’, ’employeemaster’ This … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 32 Comments

Renaming a column in Sql Server

 We often need to change the name of a column of a table to a new name. We  can do this with the help of the Exec Sp_rename command.  The Syntax of the Sp_rename is given below:-  Exec sp_rename ‘TableName.[OldColumnName]’, ‘[NewColumnName]’, … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 13 Comments

How to find duplicate values in a table

Sometimes duplicate values in tables can create a major problem when we do not make a primary key or a unique key on a table. In these cases we need to find out the duplicate records and need to delete … Continue reading

Posted in Interview Questions, SQL Basic Concepts, SQL Server | Tagged , | 33 Comments

Difference between Delete and Truncate Command

Although the Delete and Truncate Commands logically does the same work of deleting the rows from the table but still there are many differences in their working. These differences are given below:- 1) Delete command maintained the logs files of … Continue reading

Posted in Imp SQL Difference, Interview Questions, SQL Basic Concepts, SQL Server | Tagged | 1 Comment

IDENTITY Property in SQL Server

  IDENTITY  Property Sometimes we need a column whose values can uniquely identifying the rows in the table. To achieve this purpose, this column should contains the unique values and it can’t contains the NULL or empty values. We can … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 33 Comments

How to make database offline or online

Database is made offline to move its physical files. There can be many ways to make a database offline. But there are three main methods which are used frequently to make the database offline. These methods are given below:- CodeProject … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 2 Comments

Different ways to create a table and insert data into the table

Introduction Tables can be defined as the structure which contains the data in the database. This article discuss about the different ways to create a table and insert data into the table. Some of the ways to create a table … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , , | 1 Comment