guid

what type of database record id to use: long or guid ?

Hi In recent years I was using MSSQL databases, and all unique records in tables has the ID column type of bigint (long). It is autoincrementing and generally - works fine. Currently I am observing people prefer to use GUIDs for record's identity. Does it make sense to swap bigint to guid for unique record id? I think it doesn't make...

How can I create a guid in MFC

I need to be able to create guids on the fly. Is there a way to do that in MFC? I see how to do it in .net, but we haven't gone there yet. If not, do you have pointers to some code I can use? ...

Command line GUID for Unix and Windows?

Is there a command line tool for unix and windows that uses the same algorithm to create GUIDs for both platforms? ...

Improving performance of cluster index GUID primary key

Hi, I've a table with large number of rows (10K+) and it primary key is GUID. The primary key is clustered. The query performance is quite low on this table. Please provide suggestions to make it efficient. ...

How do you convert SYS_GUID() to varchar?

In oracle 10g, how do you convert SYS_GUID() to varchar? I am trying something like: select USER_GUID from user where email = '[email protected]' Which returns the RAW byte[]. Is it possible to use a function to convert the RAW to VARCHAR2 in the SQL statement? ...

How to have partial incremental synchronizations based on a GUID?

I need to synchronize an SQL Server database to Oracle through an Oracle Transparent Gateway. The synchronization is performed in batches, so I need to get the next set of data from the point where I left off. The problem I'm having is that the only field I have in the source, to help me, is a GUID. If it were a number I could just orde...

Inject custom type conversion to .NET library classes

I would like to implement conversion between two library classes by Convert.ChangeType in C#. I can change neither of the two types. For example converting between Guid and byte[]. Guid g = new Guid(); object o1 = g; byte[] b = (byte[]) Convert.ChangeType(o1, typeof(byte[])); // throws exception I am aware that Guid provides a ToByteA...

How many characters are there in a GUID?

Using ASCII encoding, how many characters are there in a GUID? I'm interested in the Microsoft style, which includes the curly brackets and dashes. ...

'None' or 'Not Used' foreign key when using GUIDs as primary key

We are building an application that may need to be replicated to many servers (I'm hoping not, but there's no way to know if clients will need their own client/server copy until after we release the online product). Since the number of servers is unknown, I've decided to use GUIDs for any transactional table IDs. Since each client ha...

Oracle SYS_GUID does not change

I have an Oracle project that would be a good fit for using GUIDs as a key. I found the following snippet SET SERVEROUTPUT ON BEGIN FOR indx IN 1 .. 5 LOOP DBMS_OUTPUT.put_line ( SYS_GUID ); END LOOP; END; / From http://feuerthoughts.blogspot.com/2006/02/watch-out-for-sequential-oracle-guids.html When I run it against my database (I ...

How easily can you guess a GUID that might be generated?

GUIDs get used a lot in creating session keys for web applications. I've always wondered about the safety of this practice. Since the GUID is generated based on information from the machine, and the time, along with a few other factors, how hard is it to guess of likely GUIDs that will come up in the future. Let's say you started 1000...

How can I find all the Guids in some text?

I've got a bunch of web page content in my database with links like this: <a href="/11ecfdc5-d28d-4121-b1c9-1f898ac0b72e">Link</a> That Guid unique identifier is the ID of another page in the same database. I'd like to crawl those pages and check for broken links. To do that I need a function that can return a list of all the Guids ...

Best place for unique ID in DOCX (Open XML WordprocessingDocument)

Hi, I am looking for a way to indentify DOCX files if they are moved or renamed. Reason is obvious, I am playing with the Open XML SDK, building a hyperlink checker. Works perfect, at least it can add or update hyperlinks in a document. Problem is, though, if I rename an external file (source.docx + target.docx to targetB.docx) the lin...

Securing AJAX Requests via GUID

I'm writing a web app that will be making requests via AJAX and would like to lock down those calls. After a little research, I am considering using some form of random token (string) to be passed back along with the request (GUID?). Here's the important parts of my algorithm: Assign a token to a JavaScript variable (generated server...

Convert string to GUID in Actionscript 3

Hello, I'm retrieving an GUID from a webservice with Flex. With this GUID i have to retrieve an Username from the webservice. The output gives me a "The key supplied is invalid. It must be of type System.Guid." I looked everywhere for a solution, but I can't find the right answer. Anyone? Thanks! edited: Is there a way to convert a ...

Sequential GUID in Linq-to-Sql?

I just read a blog post about NHibernate's ability to create a GUID from the system time (Guid.Comb), thus avoiding a good amount of database fragmentation. You could call it the client-side equivalent to the SQL Server Sequential ID. Is there a way I could use a similar strategy in my Linq-to-Sql project (by generating the Guid in code...

Accessing Guid members in C#

Hello, In C++ we can access members of a guid in the following way: GUID guid = {0}; CoCreateGuid(&guid); dwRand = guid.Data1 & 0x7FFFFFFF; The structure of guid in C++ is: Data 1 - unsigned long Data 2 - unsigned short Data 3 - unsigned short Data 4 - unsigned char Question: How to translate the third line in the C++ code (dwRand...

Using Guid in ADO.Net Data Service

I'm pulling my hair out on this one. I'm trying to implement a ADO.Net Data Service that uses a Linq to SQL data context. I thought I had it working, but the URL for one of my tables always gets an exception. The obvious difference between the table that isn't working and the ones that are, is that the one getting the exception is usi...

What is the correct way of using the Guid type in a XSD file?

I have a .xsd file which I use to generate code with the xsd.exe tool from Visual Studio. Some class members are Guids and the xsd.exe tool gives 2 warnings: Namespace 'http://microsoft.com/wsdl/types/' is not available to be referenced in this schema. Type 'http://microsoft.com/wsdl/types/:guid' is not declared. The Guid type is recog...

How do you initialise a const array of TGUID from Interface type data, in Delphi?

I want to initialise an array like this - Const MyArray : Array[0..0] Of TGUID = (IInterface); But it results in - [DCC Error] Test.pas(10): E2010 Incompatible types: 'TGUID' and 'string' So to see what would happen I tried this - Const MyArray : Array[0..0] Of String = (IInterface); Which results in this! [DCC Error] Test.pas(...