blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

SSIS Junkie

SSIS Nugget: NEWID() function in the SSIS Pipeline

Very short blog post this one.

A guy on the SSIS Forum recently wanted to add a new GUID into the pipeline and was pertubed that there was no equivalent of T-SQL's NEWID() function in the SSIS Expression Language with which to do it. I agree that there SHOULD be a function to do it and I hope that one will one day appear.

In the meantime, we have to resort to a trusty old script component to help us out. Assuming a column called GUID of type DT_GUID exists in the pipeline then the following code will do what is required:

Imports System
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Public
Class ScriptMain
  Inherits UserComponent
  Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
    Row.GUID = System.Guid.NewGuid
  End Sub
End
Class

Hope that helps!

Told you it was a short blog post!!!

 

-Jamie

 

Published 04 August 2006 09:41 by jamie.thomson

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

News

Powered by Community Server (Personal Edition), by Telligent Systems