Posted by Pharaoh on November 4, 2010 ·
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 [...]
Posted by Pharaoh on November 4, 2010 ·
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 [...]
Posted by Pharaoh on November 3, 2010 ·
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' [...]
Posted by Pharaoh on October 21, 2010 ·
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 [...]
Posted by Pharaoh on October 11, 2010 ·
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. [...]