如何在SQL Server 2008中使用GUID数据类型? [英] how can I use GUID datatype in SQL Server 2008?
本文介绍了如何在SQL Server 2008中使用GUID数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用SQL SERVER 2008
建立一个employees表,并且在我的表中我想为每个雇员提供一个ID.
I want to build an employees table using SQL SERVER 2008
, and in my table I want to have an ID for each employee .
我听说过 GUID ,并且我有点理解它是一种数据类型,但是我不能使用它
I heared about GUID and I kind of understood that its a data type , But I couldn't use it
能否请您告诉我使用方法...
could you please show me the way to use it ...
顺便说一句,我要这样的东西:
by the way , lets say I want something like this :
CREATE TABLE Employees (
ID guid PRIMARY KEY,
Name NVARCHAR(50) NOT NULL
)
我该怎么办?因为我想从中受益,但是我找不到如何做到的
How can I do it ?? because I want to benefit from it , but I couldn't find out how to do that
推荐答案
在SQL Server中未将其称为GUID.叫做uniqueidentifier
It's not called GUID in SQL Server. It's called uniqueidentifier
这篇关于如何在SQL Server 2008中使用GUID数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文