?
Solved

uniqueidentifier

Posted on 2002-04-02
1
Medium Priority
?
694 Views
Last Modified: 2012-06-21
hello, what's is uniqueidentifier datatype in MSSQL? I've just created a field with this type and trying to fill it, but i've got error message: "the value you entered is not consistent with the data type or length of the column" .. just curious ..
0
Comment
Question by:powerfool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
EstebanFG earned 200 total points
ID: 6913572
uniqueidentifier is used to store Global Unique Identifiers (GUID).  For example, the Unique ID's that are stored in your system's registry when a DLL is registered.
In order to fill it, you can try two things:
1) Use the NEWID function.
    Example:
       insert into <tablename>(<columnname>)
       values(newid())

2)  You insert a string with the following format:

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, in which each x is a hexadecimal digit in the range 0-9 or a-f.
For example, 6F9619FF-8B86-D011-B42D-00C04FC964FF is a valid uniqueidentifier value.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question