Yearly Archives: 2009

Sql Server- Difference between Stored Procedure and Function

By | December 22, 2009

In Sql Server, both functions and stored procedures can be defined as the logically grouping of Sql statements formed to complete a task, but still there are many differences between Stored procedure and Functions. These differences can be summarized as follows:- 1) A stored procedure can return a value or it may not return any… Read More »

Difference between Delete and Truncate Command

By | December 17, 2009

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 each deleted row but Truncate command do not maintain the logs files for each deleted… Read More »

Sql Server – How to write a Stored procedure in Sql server

By | December 5, 2009

Stored Procedure:- Stored Procedure In Sql server can be defined as the set of logically group of sql statement which are grouped to perform a specific task. There are many benefits of  using a stored procedure. The main benefit of  using a stored procedure is that it increases the performance of the database.The other benefits… Read More »

How to make database offline or online

By | October 13, 2009

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 1)With the help of Alter database Command:- We can make the database offline or online… Read More »

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

By | October 12, 2009

Tables can be defined as the structure which contains the data in the database. There can be many ways to create table and to insert data into the table. Some of the ways to create a table is given below:- 1)Creation of a table with the help of a create statement For example, suppose we… Read More »

Difference between Primary key and Unique key

By | October 5, 2009

var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”); document.write(unescape(“%3Cscript src=’” + gaJsHost + “’ type=’text/javascript’%3E%3C/script%3E”)); try { var pageTracker = _gat._getTracker(“UA-11608194-1”); pageTracker._trackPageview(); } catch(err) {} Both Primary key and Unique key enforce uniqueness of the column on which they are defined but still there are some differences between them. The differences are defined… Read More »

Sql server Constraints – Primary Key, Foreign Key, Unique Key, Not Null, Check Constraints

By | August 19, 2009

A constraint is a property that is assigned to a column or a group of columns to prevent incorrect or corrupt data from entering into the tables. These constraints ensure the accuracy and reliability of the data into the tables. Let’s suppose we have two tables Employee and Department whose description is given below:- CREATE… Read More »