Sequence Generator in SSIS
I am trying to have a Sequence Generator in SSIS. I saw the below link: http://www.sqlis.com/sqlis/post/Generating-Surrogate-Keys.aspx However, that is for SSIS 2005. I dont know C# coding and quite new to SSIS too. So i need help to generate Sequence for SSIS 2008.(Microsoft Visual C# 2008) I tried to make some similar simple code as below: using System; using System.Data; using Microsoft.SqlServer.Dts.Pipeline.Wrapper; using Microsoft.SqlServer.Dts.Runtime.Wrapper; public class ScriptMain : UserComponent { // New internal variable to store the rownumber private int rowCounter = 1; // Method that will be started for each record in you dataflow public override void Input0_ProcessInputRow(Input0Buffer Row) { // Indent counter rowCounter++; // Fill the new column Row.RowID = rowCounter; } } But i get this error: Microsoft.SqlServer.Dts.Pipeline.CannotCreateUserComponentException: Cannot create user component class. Make sure there is one class marked with SSISScriptComponentEntryPointAttribute in your script. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.CreateUserComponent() Need help. Thanks !
July 13th, 2011 5:31pm

what is the problem with this code? do you want to convert it and run it in SSIS 2005? if yes, you should convert it to vb.net as SSIS 2005 doesn't support C#.http://www.rad.pasfu.com My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
July 13th, 2011 5:49pm

Hi there! Start from scratch. Add a new script task to the control flow. Copy the INSIDE of the script above and paste it into the code that SSIS generated for you - only copy from the line that starts with the "// New internal" to the second-last closing curly bracket. The error you're receiving is due to some "decoration" not being there at the top of the file. Talk to me now on
July 13th, 2011 9:59pm

I think you forgot the row above the class declaration. Something like: [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute] Here is an other C# example: http://microsoft-ssis.blogspot.com/2010/01/create-row-id.html Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2011 2:11am

This is msdn sample for how to create auto increment column; http://support.microsoft.com/kb/908460http://www.rad.pasfu.com My Submitted sessions at sqlbits.com
July 14th, 2011 2:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics