Tag Archives: SQL Tables

SQL Script to find the tables created from a given date

Below is the SQL query which can be used to find out the tables which are created or modified on or from a given date. SELECT         [name] as Tablename        ,create_date       … Continue reading

Posted in DBA, SQL Advanced, SQL Server | Tagged , | 29 Comments

T-SQL script to find the highly populated tables in database

Sometimes we need to check which tables of our database is highly populated. Below is the T-SQL Script which we can use to find out that. SELECT      t.NAME AS TableName,     i.name as indexName,     sum(p.rows) … Continue reading

Posted in DBA, SQL Advanced, SQL Server | Tagged , | 27 Comments

Adding , Deleting and Updating a Column in a table

Many times we need to alter the table definition by adding , deleting or updating a column in the table. In this article, I am trying to explain the following :- 1. How to add a column 2. How to … Continue reading

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

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

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