Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DLLs and Stored Procedures from within Trans Scr

Author  Topic 

www051906
Starting Member

7 Posts

Posted - 2005-10-25 : 09:50:12
I'm importing into a table that has a uniqueidentifier column. I've written a dll that generates a GUID in Visual Basic using the CoCreateGuid API. Can I call that dll in my transformation activex script that gets this GUID and writes the value to this column? Currently I'm getting a "Transform Data Task" error when running this script that reads: "The number of failing rows exceeds the maximum specified. ActiveX Scripting Transform 'DTSTransformation_1' encountered an invalid data value for 'GID_ID' destination column."

My script is below. I'm using the dll code from this site: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q176790

Function Main()

Set oGUIDCreator = CreateObject("GUID.CreateGUID")
DTSDestination("GID_ID") = oGUIDCreator.GetGUID
Set oGUIDCreator = Nothing

DTSDestination("SYS_ID") = DTSSource("Col002")
DTSDestination("SYS_Name") = DTSSource("Col003")
DTSDestination("MMO_AddrBusiness") = DTSSource("Col005")

...


If I cannot call a dll here, can I do this via a stored procedure that uses NewID()?

Any help greatly appreciated as I'm new to SQL and DTS.

Thanks!

www051906
Starting Member

7 Posts

Posted - 2005-10-25 : 10:09:21
fyi, in case anyone is interested....

the GUID code that I was using from microsoft didn't put the GUID in this format:

6F9619FF-8B86-D011-B42D-00C04FC964FF

Once I added the dashes in the correct places, I was able to add my GUIDs programatically in the transformation script. Thanks to anyone who spent time reading this post.
Go to Top of Page
   

- Advertisement -