guid

Handling null GUIDs in SQL Server and strongly typed datasets

I have a table in SQL server: Categories -------------- CategoryID (uniqueidentifier) ParentCategoryID (uniqueidentifier) allow nulls ParentCategoryID is meant to hold a value in CategoryID to indicate which category is the parent. If it has no parent (i.e. it's a top category) then ParentCategoryID should be null. I'm using strong...

Does sql server check for duplicate GUID on insertion?

When inserting a guid as a primary key does the db server go through every single row to make sure there's no duplicate or does it just assume that a duplicate is not possible or very unlikely? with int the db server can simply increment the key but not the case with GUIDs ...

Configure Hibernate to use Oracle's SYS_GUID() for Primary Key

I am looking for a way to get hibernate to use oracle's SYS_GUID() function when inserting new rows. Currently my DB tables have SYS_GUID() as the default so if hibernate simply generated SQL that omited the value it should work. I have everything working, but it is currently generating the UUID/GUID in code using the system-uuid genera...

Regex to get a guid from a email reply

Trying to figure out the Regex pattern to match if an email contains a Guid, e.g. [email protected] The Guid could potentially be anywhere before the @, e.g. [email protected] ...

ASP.NET Membership Provider, User ID GUID, and disk space

I'm currently using the SQL Membership provider for ASP.NET, which uses GUIDs for the User ID. My application has several custom tables that have foreign key relations back to the User table and I'm concerned about the disk space and performance implications of the standard provider's use of GUIDs for user ID. Has anyone run into space...

How does this JavaScript function create a GUID?

I came across this JavaScript function and I don't understand quite what it's doing, especially with the use of 0xF. What does the 0xF do, exactly. It looks like a null nibble to me. function() { var g = ""; for(var i = 0; i < 32; i++) g += Math.floor(Math.random() * 0xF).toString(0xF) return g; } ...

Why is the 14th character in a GUID generated by Visual Studio sometimes lowercase

Occasionally when I generate a GUID using visual studio, the 14th hex character is lowercase while the rest of the hex digits are uppercase. Cause a bit of problem when comparing the string representations of two GUIDs. Now I always compare the binary equivalents to be safe. ...

Linq insert on primary key field that is autosync

I more or less want to do what this question suggests. http://stackoverflow.com/questions/507515/how-do-i-manually-set-an-identity-field-in-linq-to-sql-identity-insert However, I want to explain. I have a client db. I load Linq objects from here and the send them across WCF. On the other side, I attach them to a data context and post th...

MS Dynamics CRM - database GUIDs

I was using the SDK for CRM, and printed out the PK on a bunch of instances of one of our entities. I repeated it with the database's filtered views, and got the same answer: 1a6c691d-391a-de11-8b0e-0050568407cb bd7b0ff0-391a-de11-8b0e-0050568407cb ed272bfe-391a-de11-8b0e-0050568407cb ... and so on ... These don't app...

CRM: Create instance of an entity with a particular GUID

Using the Dynamics CRM I'm trying to create an instance of an entity. I would like to manually set the GUID, but if I had the attribute that is the primary key to the DynamicEntity, I get "Service could not process request" back. I am building a DynamicEntity, and setting the [entityname]id attribute causes the request to fail. It's mov...

When would you use GUIDs as primary keys?

Possible Duplicate: Advantages and disadvantages of GUID / UUID database keys Are there any circumstances where it is essential to use GUIDs as primary keys in a SQL Server 2005/8 DB. For example, does the use of the MS Sync Framework force this, or data replication? ...

How to use Guids in C#?

Code Something = new Guid() is returning 00000000-0000-0000-0000-000000000000 all the time and I can't tell why? so, why? ...

How short can a GUID id be?

I know the standard GUI ids. Can they be made shorter? What is the theory behind it? ...

How do I change a DCOM's guid in vb6?

I have a windows service that is instantiating a dcom object with a certain guid A. I need to replace that dcom object with a new version. When I create and compile my replacement dcom object it is created with a guid B. How do I change the replacement dcom object's guid from guid B to guidA? ...

What is the simplest unique identifier available in .Net?

So I have this public class Foo { public int UniqueIdentifier; public Foo() { UniqueIdentifier = ???? } } How do I get a completely unique number? Thanks! ...

What is a good strategy for migrating a hibernate class from a sequence based integer primary key to a GUID primary key while retaining the old keys for backward compatiblity?

We have an extensive class hierarchy (using the joined-subclass model) where the base class has a Long primary key generated from a sequence in the DB. We are working on transitioning to a GUID primary key, but wish to retain the old primary key (both in old and newly created content) for legacy apps. While the implementation seems f...

Inserting GUID into SQL Server

I have a stored proc were I want to insert a GUID (user id) into a table in MS SQL but I keep getting an error about the hyphen '-' that is part of the guid value, here's my proc defined below; @userID uniqueidentifier, @bookID int, @dateReserved datetime, @status bit INSERT INTO Reservation(BookId, DateReserved, [Status], UserId) VAL...

What is the string length of a Guid?

I want to create a varchar folumn in SQL should contain N'guid' while guid is a generated Guid by .net (Guid.NewGuid). What is the length of the varchar I should expect from a Guid? is it a static length? Should I use nvarchar (will Guid ever use unicode chars)? varchar(Guid.Length) PS. I don't want to use SQL row guid data-type, jus...

How to generate a GUID in VBScript?

I want to generate GUID strings in VBScript. I know that there's no built-in function in VBScript for generating one. I don't want to use random-generated GUIDs. Maybe there is an ActiveX object that can be created using CreateObject() that is sure to be installed on (newer) Windows versions that can generate a GUID? ...

The GUID of the entity on a custom field

Hi! I want to create a custom textfield in a serviceactivity. When the serviceactivity onloads I would like to have the serviceactivities GUID in that textfield. Does anyone have any idea how I can solve this? ...