Solved

uniqueidentifier

Posted on 2002-04-02
1
686 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
1 Comment
 
LVL 1

Accepted Solution

by:
EstebanFG earned 50 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now