Archive : SQL Server

RSS feed
using IDentity Columns in Sql Server

using IDentity Columns in Sql Server

For More Information about sql server identity please visit this post : IDentity in Columns Sql Server Creating a Table With an Identity Columns Create Table Users (userID int Identity , UserName nvarchar(255) , Password  nvarchar(255)) Inserting a row Insert Into Users (UserName,Password) Values ('Nicolas','123654789654') Or Insert Into Users Values ('Nicolas','123654789654') Note that sql [...]
IDentity Columns Sql Server

IDentity Columns Sql Server

By Craig S. Mullins The identity property is a very powerful and useful, yet under-utilized feature of Microsoft SQL Server.  It satisfies a common requirement of many applications: the need for a sequential, ascending identifier. Whenever there is a need for a database column to contain a serial number, the identity property can be used to simplify the implementation. The primary benefit of the [...]
Select Case Sql Server

Select Case Sql Server

In alot of situations we find that we need to display data to the user that’s not actually in the database tables for eamples let’s think about a table containing employees data Create Table Employees (ID int identity primary key , Name nvarchar(255) , isMarried bit ) insert into Employees Values ('John' , 0) insert into Employees Values ('Debra' , 1) insert into Employees Values ('Paul' [...]
Rebuild All Database Indexes SQL Server

Rebuild All Database Indexes SQL Server

Background :: in SQL Server 2000 and Above we can use System Catalog View to Obtain Meta Data about our database For Example we can list all of database tables using sys.tables . select * From sys.tables and also we can list all indexes in a database using sys.indexes select * From sys.indexes we can join those together using a common column (object_id) Select I.Name 'Index Name' , T.Name 'Table [...]
When should you use database constraints….?

When should you use database constraints….?

Consider the following diagram. It’s a map of the flow of data from your user, which eventually makes its way into the database. Since we’re getting input from a user, and they’re the one that can fix invalid data, we validate data at the top layer. There’s usually no getting around this. In fact, for the best user experience on the web, you’re going to perform some JavaScript validation. [...]
© 2010 Programming online. All rights reserved.
WordPress Themes
freshlife WordPress Themes Theme Junkie