Advertisements

Archive

Author Archive

PowerShell script to backup a database and restore on other server.

December 16, 2012 18 comments

Many a times as a DBA when we need to refresh our QA or Dev environment with Production environment, we need to have a full backup of Production database and then manually we need to restore them in other environments. The following is  a simple power shell script to just take a full backup with copy only option and then restore it on other server. Read more…

Advertisements

Count number of rows in stored procedure

October 12, 2012 Leave a comment

              Many a times in our daily life of a SQL development/DBA profile, we have to spend our day across stored procedures, and we need to find out how many rows are there in any stored procedures, especially when we have to do some analysis or while  we have to review any stored procedure for evaluation or estimation, the very first thing which comes in everyone’s thought is, how big is the stored procedures the following are the simple ways to get the approximate number of rows in stored procedure. Read more…

Sequence Vs Identity – SQL Server 2012

June 6, 2012 6 comments

What is sequence?

Sequence is a newly introduced database object in Sql Server 2012, Sequence is used to generate a sequence of numeric values in either ascending or descending order, along with an option to have the minimum and maximum values and also allows to cycle and cache for better performance.

Read more…

Powershell – Powershell Script to backup all user DBs in SQL Server

Powershell is Microsoft’s task automation framework.

The following is a simple powershell script to take full backup of all users database of MS SQL Server, this script is tested on MS SQL Server 2008R2 and MS SQL Server 2012(Denali). Read more…

Table Attributes Dependencies in Store Procedures with SQL Server 2012

May 21, 2012 2 comments

Couple of days back I got an opportunity to migrate the existing Sybase ASE database (Adaptive Server Enterprise/15.0.2) to my favorite MS SQL Server 2012, to find out the feasibility of migration activity in near future.

Our team consists of Project Manager, Database architect and few of the senior guys we all concluded to just migrate the database objects from Sybase to SQL Server 2012, and along with the migration we need to find out dead objects in the existing database which is being carried so far. Here the dead objects means such tables, columns and views which are no more in use. Read more…

%d bloggers like this: