Tag Archives: SQL Database

SQL Script to find the databases size

By | January 20, 2015

Sometimes we need to find out the size of the database on a server. Below SQL Scripts can be used to find out the size of all the databases created on the server.  ;WITH DBSize (SqlServerInstanceName, DatabaseName, DatabaseSize, DBLogSize, TotalDBSize) AS (   SELECT      @@SERVERNAME SqlServerInstanceName,             db.name AS… Read More »

T-SQL script to find the growth size of database files

By | January 9, 2015

Below query can be used to see the growth size of database files. DECLARE @filename NVARCHAR(1000); DECLARE @bc INT; DECLARE @ec INT; DECLARE @bfn VARCHAR(1000); DECLARE @efn VARCHAR(10); — Get the name of the current default trace SELECT @filename = CAST(value AS NVARCHAR(1000)) FROM ::fn_trace_getinfo(DEFAULT) WHERE traceid = 1 AND property = 2; — rip… Read More »

How to restore database backup in SQL SERVER

By | August 17, 2014

In this article, I am going to explain the process of  Database restoration using the SQL Server Management Studio. In this article, I will try to explain this process in a simple way so that a database developer having little knowledge of DBA can restore that database using the database backup. For database restoration process,… Read More »

Database Creation using SQL Sever Management Studio (SSMS)

By | August 17, 2014

In the previous article (Database Creation using Create Database command), I explained the database creation using the Create database command. In this article, I am going to explain the steps of creation a database using SQL Sever Management Studio (SSMS) using SQL Server 2008 R2. These below database creation steps will be same for SQLServer… Read More »

Database Creation using Create Database command

By | August 17, 2014

In SQL Server, database can be created by 2 ways:-  Using Create Database command  Using SQL Sever Management Studio (SSMS). In this article, I am going to explain the database creation using the command CREATE DATABASE. Syntax for creating a database through Create database command is given below:- CREATE DATABASE  ‘Database name’ ON  PRIMARY  … Read More »