Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP GUID(16) to SQL UID
Message
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Miscellaneous
Thread ID:
01230551
Message ID:
01230631
Views:
32
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform