----------------------------------------------------------------------------------
-- Blog: http://blog.csdn.net/htl258
-- Subject: describes the Globally Unique Identifier newsequentialid introduced by sql2005.
----------------------------------------------------------------------------------
-- The newsequentialid () function returns the uniqueidentifier of each byte. The main difference with newid () is:
-- Newsequentialid (): The new value is greater than the value generated last time. Unlike newid (), this function cannot
-- Called directly in the query. It can only be 'uniqueidentifier' In the create table statement or alter table statement'
-- Used in the default expression of a column of the type.
--> Generate a test data table: [TB]
If object_id ('[TB]') is not null
Drop table [TB]
Go
Create Table [TB] (ID uniqueidentifier default newsequentialid (), [a] [int], [B] [int])
Insert into [TB] ([a], [B])
Select '1', '2' Union all
Select '2', '3' Union all
Select '4', '5'
Select * from [TB]
/*
ID a B
----------------------------------------------------------
8783e9b7-2c5d-df11-a05c-001cbf7c5a9c 1 2
8883e9b7-2c5d-df11-a05c-001cbf7c5a9c 2 3
8983e9b7-2c5d-df11-a05c-001cbf7c5a9c 4 5
(3 rows affected)
*/
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/htl258/archive/2010/05/12/5580900.aspx