uniqueidentifier

cutdown uuid further to make short string

微笑、不失礼 提交于 2019-12-04 03:49:22
I need to generate unique record id for the given unique string. I tried using uuid format which seems to be good. But we feel that is lengthly. so we need to cutdown the uuid string 9f218a38-12cd-5942-b877-80adc0589315 to smaller. By removing '-' we can save 4 chars. What is the safest part to remove from uuid? We don't need universally unique id but we like to use uuid as a source but cut down strings. We need unique id specific to site/database (SQL Server/ADO.NET Data services). Any idea or sample from any language is fine Thanks in advance Spencer Ruport Why not instead just convert it to

Retrieve the uniqueidentifier key value for a record

岁酱吖の 提交于 2019-12-03 20:50:44
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 call scope_identity(). How should I proceed with guids? Thanks, Lucian Paul Nearney I would generate a new Guid prior to inserting the record, and explicitly use this new Guid as the PK for the record. You then use that guid after the insert, knowing that it refers to the row you

Is it normal to have two elements with same id in two div elements with other id : updated

让人想犯罪 __ 提交于 2019-12-03 18:03:12
问题 i know, that two elements can't hav the same id. But it's happens so, that in my project i have two elements with same id in other divs, like this <div id="div1"> <img id="loading" /> </div> <div id="div2"> <img id="loading" /> </div> and css: #div1 #loading { some style here... } #div2 #loading { another style here... } works fine for me, but maybe it is not reccomended to do by so? Thanks UPDATE Yes, i know, thet i can use classes, and it's strongly recomended to do by so, but i want to

NewSequentialId on UniqueIdentifier Clustered Index

三世轮回 提交于 2019-12-03 14:49:14
I am working on database standards for a new database my company is starting. One of the things we are trying to define is Primary Key and Clustered Index rules in relation to UniqueIdentifiers. (NOTE: I do not want a discussion on the pros and cons of using a UniqueIdentifier as a primary key or clustered index. There is a ton of info on the web about that. This is not that discussion.) So here is the scenario that has me worried: Say I have a table with a UniqueIdentifier as the clustered index and primary key. Lets call it ColA. I set the default value for ColA to be NewSequentialId().

How to generate and manually insert a uniqueidentifier in sql server?

◇◆丶佛笑我妖孽 提交于 2019-12-03 14:44:48
问题 I'm trying to manually create a new user in my table but impossible to generate a "UniqueIdentifier" type without threw an exception ... Here is my example: DECLARE @id uniqueidentifier SET @id = NEWID() INSERT INTO [dbo].[aspnet_Users] ([ApplicationId] ,[UserId] ,[UserName] ,[LoweredUserName] ,[LastName] ,[FirstName] ,[IsAnonymous] ,[LastActivityDate] ,[Culture]) VALUES ('ARMS' ,@id ,'Admin' ,'admin' ,'lastname' ,'firstname' ,0 ,'2013-01-01 00:00:00' ,'en') GO Trow exception -> Msg 8169,

Thread.getId() global uniqueness question

这一生的挚爱 提交于 2019-12-03 11:38:08
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 unique across all applications, won't that leak some (although very minor) information about other applications on the system? Such as how many threads have started in other applications, or even if other Java applications are running at all? Well, let me check the

How to obtain the android_id of a device? [duplicate]

放肆的年华 提交于 2019-12-03 11:06:12
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Is there a unique Android device ID? In the licensing documentation the android developers mention an easy way to more or less securely identify an android device. They are using android.Settings.Secure.ANDROID_ID. They say they query the system settings for this. But they don't explain this any further. How do I obtain the android_id and do I need special permissions for doing so? 回答1: It's all in the Javadoc,

Generating unique and opaque user IDs in Google App Engine

时光怂恿深爱的人放手 提交于 2019-12-03 10:30:37
问题 I'm working on an application that lets registered users create or upload content, and allows anonymous users to view that content and browse registered users' pages to find that content - this is very similar to how a site like Flickr, for example, allows people to browse its users' pages. To do this, I need a way to identify the user in the anonymous HTTP GET request. A user should be able to type http://myapplication.com/browse/<userid>/<contentid> and get to the right page - should be

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

会有一股神秘感。 提交于 2019-12-03 09:45:00
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 the developers like to work with it. (They love the LiNQ support.) So here's the problem: With peer-to-peer replication in mind, I settled on using uniqueidentifier with a default value of newsequentialid() for the primary key of every table. This seemed to provide a

Unique identifier for user profiles in Windows

你说的曾经没有我的故事 提交于 2019-12-03 09:13:23
For a client/server application I need to centrally store parts of the configuration information that usually goes into the users profile directory. The client application would on first use write a file or registry entry with a GUID into the current profile. This GUID would subsequently be used as a key in the configuration database on the server. Now I'm wondering if Windows user profiles already have unique identifiers I could use instead of generating my own GUIDs. The username won't work because users might have multiple profiles. Combining it with the computer name won't work because