首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

NEWID创建uniqueidentifier类型的唯一值

整理日期:2007年08月19日 【字体:


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-08/1187531665.html



说明 对于每台计算机,由 NEWID 返回的值不同。所显示的数字仅起解释说明的作用。


B.在 CREATE TABLE 语句中使用 NEWID
下面的示例创建具有 uniqueidentifier 数据类型的 cust 表,并使用 NEWID 将默认值填充到表中。为 NEWID() 赋默认值时,每个新行和现有行均具有 cust_id 列的唯一值。

-- Creating a table using NEWID for uniqueidentifier data type.
CREATE TABLE cust
(
 cust_id uniqueidentifier NOT NULL
  DEFAULT newid(),
 company varchar(30) NOT NULL,
 contact_name varchar(60) NOT NULL,
 address varchar(30) NOT NULL,
 city varchar(30) NOT NULL,
 state_province varchar(10) NULL,
 postal_code varchar(10) NOT NULL,
 country varchar(20) NOT NULL,
 telephone varchar(15) NOT NULL,
Tags:
NEWID创建uniqueidentifier类型的唯一值
'http://www.etoow.com/html/2007-08/1187531665.html
1
 
2
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved