|
Posted by Erland Sommarskog on 08/05/06 08:00
Dot Net Daddy (cagriandac@gmail.com) writes:
> What is uniqueidentifier as a data type?
A uniqueidentifier is a 128-bit value, which is generated in such a way
that it is guaranteed to be unique in the whole universe. (Well, at least
this planet.) They are not specific to SQL Server, but Windows has them
all over the place, but calls them GUIDs.
> Also what is the data type for setting unique STRINGS ((nchar,
> nvarchar), for example to be used for emails and user names in a user
> registration system).
>
> SQL Server does not allow me set primary keys for columns where data
> types are not INT.
Huh? You can use almost any data type for primary keys. Since a primary
key is an index, the total key size may not execeed 900 bytes, so you
cannot use things like text or nvarchar(MAX).
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|