Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP GUID(16) to SQL UID
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Divers
Thread ID:
01230551
Message ID:
01230631
Vues:
20
>So, the question : Has anyone done this ( Rick ? ) or does anyone know of a CAST() that would get the GUID(16) into UID in one go ( and perhaps give me some hints about how to incorporate that knowledge into an SSIS package )

If you specify the data source as a query, use the following for all PK/FK fields:

cast(LEFT([GUID-16 field],8)+'-'+substring([GUID-16 field],9,4)+'-'+
substring([GUID-16 field],13,4)+'87D9-9DE36423D459' as uniqueidentifier) as [field_name]

Basically, adding the dashes and tacking on the missing 18 characters on the end. Then it casts properly. Since you're using the same string to pad it out, all PKs and FKs will still match.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform