May 11, 2005 at 8:50 am
My client needs to extract various columns of type varbinary into a flat file. This file is used in a dialer program that requires a flat file. The dialer program produces a results file (also a flat file) with the orginal data passed in along with various updates. The guid columns do not get updated. I need a way to convert the GUID to a string, pass it through the dialer program and then take the results file and update the original source table based on the guid column. The guid is the primary key for the source table.
I have found the undocumented stored proc: sp_MSguidtostr to get the guid to a string but can not get the string to match up with the original guid.
Any help or thoughts is appreciated.
May 12, 2005 at 7:34 am
From what I understand you need guid to string (for flat file lookup) and then string to guid (database update) conversions. As long as the format of the GUIDs are not altered in the flat file you can always cast to varchar and vice-versa and compare the results:
sqlGuid1 = cast(flatfileGuid as uniqueidentifier)
strFlatFileKey = cast(sqlGuid1 as varchar(36))
-Anil
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply