guid

Switching to sequential (comb) guids - what about existing data?

We have a database with 500+ tables, in which almost all the tables have a clustered PK that is of datatype guid (uniqueidentifier). We are in the process of testing a switch from "normal" "random" guids generated through .NETs Guid.NewGuid() method to sequential guids generated through the NHibernate guid.comb algorithm. This seems to...

Get the GUID of a WebPart in SharePoint 2007

I'm trying to emit some jQuery and other Javascript that will hide and show WebParts on a page. What I'd like to do is find one of two things: The ID of the table cell that contains the WebPart (i.e. MSOZoneCell_WebPartWPQ5) The WebPartID of the div tab of the WebPart that shows in the HTML (i.e. WebPartID="059611a7-adef-479e-bda9-fe57...

A couple of questions about NHibernate's GuidCombGenerator

The following code can be found in the NHibernate.Id.GuidCombGenerator class. The algorithm creates sequential (comb) guids based on combining a "random" guid with a DateTime. I have a couple of questions related to the lines that I have marked with *1) and *2) below: private Guid GenerateComb() { byte[] guidArray = Guid.NewGuid().T...

How to Create Deterministic Guids

In our application we are creating Xml files with an attribute that has a Guid value. This value needed to be consistent between file upgrades. So even if everything else in the file changes, the guid value for the attribute should remain the same. One obvious solution was to create a static dictionary with the filename and the Guids ...

Mercurial Hg Clone fails on C# project with GUID

UPDATE: In trying to replicate this problem one more time to answer your questions I could not! I can only conclude that my initial setup of Mercurial was problematic and/or possibly I was trying to checkin a build that failed compilation before the checkin. Sigh! Thank you so very much for your help. I gave credit for the help on how to...

Convert byte array from Oracle RAW to System.Guid?

My app interacts with both Oracle and SQL Server databases using a custom data access layer written in ADO.NET using DataReaders. Right now I'm having a problem with the conversion between GUIDs (which we use for primary keys) and the Oracle RAW datatype. Inserts into oracle are fine (I just use the ToByteArray() method on System.Guid)...

Failed to convert parameter value from a Guid to a String

Hello, I am at the end of my knowledge and googled for the answer too but no luck :/ Week ago everything worked well. I did a revert on the repository, recreated the tableadapter etc... nothing helped. When I try to save in my application I get an SystemInvalidCastException at this point: PersonListDataSet.cs: partial class P_Group...

Proper QUuid usage in Qt ? (7-Zip DLL usage problems (QLibrary, QUuid GUID conversion, interfaces))

Hi, I'm trying to write a program that would use 7-Zip DLL for reading files from inside archive files (7z, zip etc). Here's where I'm so far: #include QtCore/QCoreApplication #include QLibrary #include QUuid #include iostream using namespace std; #include "7z910/CPP/7zip/Archive/IArchive.h" #include "7z910/CPP/7zip/IStre...

Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume?

Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume in c++? GetVolumeNameForVolumeMmountPoint() { LPCTSTR lpszvolumeMountPoint, LPTSTR lpszVolumeName, DWORDcchBufferLength, } I mean if I am using a removeable disk. will the lpszVolumeName remained the same on the same computer? Does it return a certain ID for a certain...

Oracle guid to other table

At the moment I'm writing a small conversion program, it will convert the primary key strategy to the using of GUIDs in stead of integers. This is a simple client induced requirement and I can't change that. I've added a substitute pk candidate of the RAW(16) to every table in the database and filled each record with a SYS_GUID(). I di...

Getting the GUID for any given path to sharepoint.

Hey, I'm trying to get the GUID of a given sharepoint URL. I don't mind using the API or the webservices or Sharepoint's database. if i were to write a function, it's signature would be: //get a GUID from path. string GetGuidFromPath(string path){} I had a lead: SPContentMapProvider but it doesn't seem to get the right info. Thank yo...

Approach for altering Primary Key from GUID to BigInt in SQL Server related tables

I have two tables with 10-20 million rows that have GUID primary keys and at leat 12 tables related via foreign key. The base tables have 10-20 indexes each. We are moving from GUID to BigInt primary keys. I'm wondering if anyone has any suggestions on an approach. Right now this is the approach I'm pondering: Drop all indexes and ...

Are GUIDs the ultimate ID?

I noticed some people don't bother having the usual incremented number as ID but instead simply generate a GUID. The advantages include: Quick and easy No need to keep track of previous IDs Guaranteed to be unique even across machines without knowledge of each other Some disadvantages are: Possibly performance bottleneck Uses a lar...

How are .NET 4 GUIDs generated?

I am aware of the multitude of questions here as well as Raymond's excellent (as usual) post. However, since the algorithm to create GUIDs was changed apparently, I found it hard to get my hands on any up-to-date information. The MSDN seems to try and provide as few information as possible. What is known about how GUIDs are generated in...

Is it possible to design our own algorithm to create unique GUIDs?

GUID are generated by the combination of numbers and characters with a hyphen. eg) {7B156C47-05BC-4eb9-900E-89966AD1430D} In Visual studio, we have the 'Create GUID' tool to create it. I hope the same can be created programmatically through window APIs. How GUIDs are made to be unique? Why they don't use any special characters like #,...

Oracle manually add an FK constraint

Alright, since a client wants to automate a certain process, which includes creating a new key structure in a LIVE database, I need to create relations between tables.columns. Now I've found the tables ALL_CONS_COLS en USER_CONSTRAINTS to hold information about constraints. If I were to manually create constraints, by inserting into thes...

using NEWSEQUENTIALID() with UPDATE Trigger

I am adding a new GUID/Uniqueidentifier column to my table. ALTER TABLE table_name ADD VersionNumber UNIQUEIDENTIFIER UNIQUE NOT NULL DEFAULT NEWSEQUENTIALID() GO And when ever a record is updated in the table, I would want to update this column "VersionNumber". So I create a new trigger CREATE TRIGGER [DBO].[TR_TABLE_NAMWE] ON [DBO]...

SQL GUID Vs Integer

Hi I have recently started a new job and noticed that all the SQL tables use the GUID data type for the primary key. In my previous job we used integers (Auto-Increment) for the primary key and it was a lot more easier to work with in my opinion. For example, say you had two related tables; Product and ProductType - I could easily cro...

Convert string value back to GUID value

hi, i have a guid value that i store in my hidden variable. say for eg (303427ca-2a5c-df11-a391-005056b73dd7) now how do i convert the value from this hidden field back to GUID value (because the method i would be calling expects a GUID value). thank you. ...

Entity Framework - SaveChanges with GUID as EntityKey

I have a SQL Server 2008 database table that uses uniqueidentifier as a primary key. On inserts, the key is generated on the database side using the newid() function. This works fine with ADO.NET. But when I set up this table as an entity in an Entity Framework 4 model, there's a problem. I am able to query the entity just fine, but whe...