Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General »

GUIDs en SQL Server

Estas en el tema de GUIDs en SQL Server en el foro de Bases de Datos General en Foros del Web. Hola colegas... Necesito saber si alguien a tenido la amarga experiencia de hacer lo siguiente... Necesito retornar el ultimo ID que se genero en una ...
  #1 (permalink)  
Antiguo 26/07/2005, 08:22
 
Fecha de Ingreso: septiembre-2004
Mensajes: 35
Antigüedad: 19 años, 7 meses
Puntos: 0
GUIDs en SQL Server

Hola colegas...
Necesito saber si alguien a tenido la amarga experiencia de hacer lo siguiente...
Necesito retornar el ultimo ID que se genero en una transacción en SQL Server, pero resulta que este id es un GUID… ya he probado con @@Identity y SCOPE_Identity y nada de esto soporta GUID, alguien ha hecho esto...??

Gracias
  #2 (permalink)  
Antiguo 26/07/2005, 14:47
Avatar de Mithrandir
Colaborador
 
Fecha de Ingreso: abril-2003
Mensajes: 12.106
Antigüedad: 21 años
Puntos: 25
Encontré esto en los Books Online:
Cita:
The uniqueidentifier data type has several disadvantages:

The values are long and obscure. This makes them difficult for users to type correctly, and more difficult for users to remember.

The values are random and cannot accept any patterns that may make them more meaningful to users.

There is no way to determine the sequence in which uniqueidentifier values were generated. They are not suited for existing applications that depend on incrementing key values serially.

At 16 bytes, the uniqueidentifier data type is relatively large compared to other data types such as 4-byte integers. This means indexes built using uniqueidentifier keys may be relatively slower than implementing the indexes using an int key.
Lo encuentras bajo el título "Using uniqueidentifier Data"
__________________
"El hombre, en su orgullo, creó a Dios a su imagen y semejanza."
Friedrich Nietzsche
  #3 (permalink)  
Antiguo 26/07/2005, 15:54
 
Fecha de Ingreso: septiembre-2004
Mensajes: 35
Antigüedad: 19 años, 7 meses
Puntos: 0
me lo imaginé, mucha gracias...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:43.