uniqueidentifier

What's the purpose of sequental uniqueidentifier in PK of MS SQL?

I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios. Integral identifiers, on the other side, have greater performance at the cost of scalability. But in what scenarios would someone want to use sequential uniqueidentifier as t...

Generating a globally unique identifier in Java

Summary: I'm developing a persistent Java web application, and I need to make sure that all resources I persist have globally unique identifiers to prevent duplicates. The Fine Print: I'm not using an RDBMS, so I don't have any fancy sequence generators (such as the one provided by Oracle) I'd like it to be fast, preferably all in mem...

What are the experiences with using unicode in identifiers

These days, more languages are using unicode, which is a good thing. But it also presents a danger. In the past there where troubles distinguising between 1 and l and 0 and O. But now we have a complete new range of similar characters. For example: ì, î, ï, ı, ι, ί, ׀ ,أ ,آ, ỉ, ﺃ With these, it is not that difficult to create some ve...

Short unique id in php

I want to create a unique id but uniqid() is giving something like '492607b0ee414'. What i would like is something similar to what tinyurl gives: '64k8ra'. The shorter, the better. The only requirements are that it should not have an obvious order and that it should look prettier than a seemingly random sequence of numbers. Letters are p...

Retrieve the uniqueidentifier key value for a record

Hello everybody, in context of SQL Server 2005, I have a table for which the primary key is a uniqueidentifier (GUID), with a default value generated by the newid() function. I want to write a stored procedure that inserts a new record into the table. How do I get the record's PK value? for an identity-declared field, this is easy - I c...

Generating a unique reference number strategies

Hrm... here's where my CS knowledge lets me down. I want to write an algorithm that generates a reference number that is unique. I don't want to use sequential numbers as they introduce a security risk and I want to use alphanumerics. The ref will have a min and max length too. (I can't use a GUID it is too long) Ideally I don't wan...

Using uniqueidentifiers/guids as custom properties in log4net

I'm trying to add a custom property which is a guid, but it gives me this error: System.InvalidCastException: Failed to convert parameter value from a String to a Guid. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'. I specify this in the config: <parameter> <parameterName value="@id...

Convert string to uniqueidentifier in VBScript

...

Ruby on Rails and MSSQL Server: trying to insert rows with newid() default values.

(this question was originally posted in another forum a few months ago, without getting any answer ... there was no SO at these times!) My first steps in RoR. I baught one of these books talking about Ruby, and Ruby On Rails. Examples are running correctly on MySQL, so I decided to rewrite them for MS-SQL as a good exercice (and as MS...

customize asp.net membership by changing "userid" type to integer

in asp.net membership is it possible to change the "userid" type from "uniqueidentifier" to "integer"? and how to do it? ...

Unique Identifier for Flash Installation

In a Flash application I would like to obtain the Flash product ID (or any other identifier which would uniquely identify a particular installation of Flash). I haven't found anything in the SDK that provides this? Any ideas? Terry. [email protected] ...

Create unique ID's in VFP

I need to create unique record id's in VFP based on mailing information: zip5, address, lastname, firstname. Once created, relational tables will be loaded in SQL server 7 with the unique ID's. Any suggestinos? ...

Generating Case Insensitive, Unique Alphanumeric Strings of Fixed Length

I have searched for an elegant solution, without luck. Ultimately, I need to create a number of unique id's (on a single machine) of a fixed length (of 3 characters) that begin with a letter, and contains only numbers or uppercase letters. (e.g. AXX, where X can be a number or letter) I am using the mktemp utility to generate the unique...

Thread.getId() global uniqueness question

If multiple Java applications are running on a system, is each Thread ID unique relative to all other Java threads, regardless of what application they are running in? Java applications are supposed to be sand-boxed relative to other Java applications so I thought it might be possible for Thread IDs to collide. If the Thread IDs are un...

Advice Please: SQL Server Identity vs Unique Identifier keys when using Entity Framework

I'm in the process of designing a fairly complex system. One of our primary concerns is supporting SQL Server peer-to-peer replication. The idea is to support several geographically separated nodes. A secondary concern has been using a modern ORM in the middle tier. Our first choice has always been Entity Framework, mainly because th...

Unique, numeric, incremental identifier

I need to generate unique, incremental, numeric transaction id's for each request I make to a certain XML RPC. These numbers only need to be unique across my domain, but will be generated on multiple machines. I really don't want to have to keep track of this number in a database and deal with row locking etc on every single transaction...

What's a good way to uniquely identify a computer?

I'm developing some desktop software for a client to resell. The client wants to restrict the software so that the registration code will be specific to one and only one computer. Besides using the MAC from the network card, does anyone have any other techniques (that work on both Windows and Mac OS X) for uniquely identifying a comput...

12 Digit Unique ID - Code reliability

Guys, I wanted a number that would remain unique for a day (24 hours). Following is the code that I came up with; I was wondering about its fallacies/possible risks; 'I believe' this guarantees a 12 digit unique number for a day atleast. Logic is to get the current date/time (hhmmssmmm) and concat the first four bytes of query perform...

Get unique identifier of a Thread in Java 1.4

In Java 1.4, is there any better way of getting a Thread's ID than using Thread.getName()? I mean, getName() in unit tests returns something like "Thread-1", but in WebLogic 10 I get "[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'.xml". ...

Clustered primary key on unique identifier ID column in SQL Server

If your ID column on a table is a unique identifier (Guid), is there any point creating a clustered primary key on the ID column? Given that they are globally unique, how would the sorting work? ...