Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Thursday, March 22, 2012

Custom Task: How to access/modify the variables of a package

Hi,

I'm trying to simplify the deployment process of my project. I already had some troubles with the config files but lets say I solved that issue. I'm going to read a flat file and set the variables of my packages from this file. I was thinking to use a Script Task to do that but I will need to copy this task in every package (I have at least 30). So if I want to make some change this will be painful.

Then, I came up with the idea of creating a Custom Task called Config File Task. I'm working on this but I got stuck trying to get the variables from the package that is running my Config File Task.

This is the code I had in the Script Task:

Dim streamReader As New StreamReader(Dts.Variables("ConfigFilePath").Value.ToString)
Dim line As String
Dim lineArray As String()
Dim variableName As String
Dim variableValue As String
Dim readConfigurations As Boolean = False

While (streamReader.Peek() <> -1)
line = streamReader.ReadLine()
If line = "[CONFIGURATIONS]" Then
readConfigurations = True
ElseIf line = "[/CONFIGURATIONS]" Then
readConfigurations = False
Else
If readConfigurations And line <> "" Then
lineArray = line.Split("|".ToCharArray())
variableName = lineArray(0).Trim()
variableValue = lineArray(1).Trim()

If Dts.Variables.Contains(variableName) Then
Dts.Variables(variableName).Value = variableValue
End If
End If
End If
End While
Dts.TaskResult = Dts.Results.Success

All I want to do is set the variables that exists in each package from the config file. In my UI Class (ConfigFileTaskUI.cs) I can have access to the variables via the TaskHost which is passed as an argument of Initialize() method.

Any thoughts? I'd really appreciate some help!

P.S. I've been working on this for 2 days!

I don't have an answer to your question, but have you looked at using package configurations (SSIS > Package Configurations from the BIDS menu)? these can be stored as simple XML files that can be used for the same purpose as what I think you are trying to do here.

Note that BIDS will not save connection string passwords for you - you would have to open the XML file and edit it manually to add these if you are using it for connection strings.

You can use these XML files to store variable values as well as lots of other properties of your package objects. You could write your own code to manipulate the contents of the XML configuration files however you like.

Another option would be to store your values in a database and fetch the values into the variables using SSIS Execute SQL tasks or a similar method.

Maybe you've thought of all this already and ruled it out for some other reason - but based on your post this would seem a much simpler method?

|||Hi Slicktop,

Yes, I tried the XML config file but you cannot have configurations that don't exists in the package. About the SSIS_Configuration table, I thought of this but it's not a good idea for my deployment process. Somehow, I need to get the information from this table and put it in a flat file so I can store it in CVS. Plus, I need to fill this table every time I deploy my packages. I know this is not so difficult but my client don't want to do this.

There is a property in the Package object which disable the warning messages from the configuration file. If I set to True, I don't get an error message when I have just one XML config file with multiple configurations which they may or may not exists in the package to be executed. I don't like doing this because it doesn't seem right.

Thanks for your ideas.|||

What about just reading the flat file using SSIS? You could either load it into a work table and then query it to set variables, or maybe even use a transform to extract the values you need.

When you say "you cannot have configurations that don't exist in the package", what do you mean exactly? Your variable names aren't defined in the package?

|||That's right!. I don't have the same variables in every package. I have a log file per package so in the flat file I have:

log_package_1 = something
log_package_2 = something
log_package_3 = something
conn_db = connection string to db
file_vpn = path to the vpn file

and so on, so in package 1 I only have declared variable log_package_1 but not the rest of the variables of my flat file. Reading the flat file with SSIS could be a possible option but the thing is I have a custom flat file, I mean it's not comma separated and I have some "tags" so I don't think SSIS can read it.

Thanks for the ideas!|||

well obviously I don't know all the details of your situation but it sure seems like you are trying to do this the hard way.

Is there some reason why your custom flat file has to have a "custom" format?

If your goal is to dynamically populate package variables, and the variable names are defined in the package definition, then you can use package configurations to do this. If your goal is to have only a single flat file that contains all variable values across multiple packages, then why not just write these into a standard, machinable format (XML, delimited file, whatever) and then use SSIS to load the file into a DB table. Then from each package, query the table for the variable values needed for that particular package and use the resultset to populate the package variables.

Your table could be generic, with two varchar columns, var_name and var_value.

so, in package 1, you could write an execute SQL task that runs "select var_value from control_table where var_name = 'log_package_1', etc.

If you put a bit of thought into this you could probably make parts of this solution quite generic so that you could write it once and copy/paste the tasks into each package or nest your packages to re-use it. for example, maybe add a "package_name" column to the control table that you could use to query all variables for a package using the same SQL.

sorry, I know I haven't answered your original question (don't know the answer) but thought maybe there is a better (easier) way to do this.

|||Why are you punishing yourself with such a masochistic task?

I mean, why not just use XML Configuration files?|||

Has the original question been answered?

The Task.Execute method is where you will place the code that reads from the file and sets variables. The execute gives you access to the VariableDispenser object as on of the parameters, in much the same way as the TaskUI.Initialize method does, is this not enough?

The Dts.Variables syntax you have used in the Script Task is not applicable, you need to manually control the locking in the variable dispenser. Look at the Lock* methods as documented for the variable dispenser.

|||Hi DarrenSQLIS,

No, the original question haven't been answered yet. I know that Dts.Variables is not applicable in my case when creating a Custom Task. I checked the VariableDispenser object and there are a few methods. For example, the GetVariables(ref Variables variables) but I don't have the collections of variables to pass it as the parameter for this method.

I think I need somehow to tell SSIS which variables are for read-only access and which ones are for read/write. Even so, I would like to know first the variable name and their respective values first. The VariableDispenser object seems useless because I don't know how to get the variables within the package that is executing my Custom Task.

My goal is to know the name of all the User Variables in a package and then set these variables to their respective values that I'm reading from a flat file.

Using XML configuration files is not a solution, I'm not going to set the SuppressConfigurationWarnings property to True in each package. Probably you think I'm trying to do it the hard way but I have to follow some constraints and standards from my client.

Thank you all for your replies.|||

The methods, GetVariables, LockOnForRead or LockOneForWrite all expect a reference parameter of type Variables. This is just the variables collection that is filled with the 'locked' variables that you have asked for, e.g.

Variables variables = null;
variableDispenser.LockOneForRead(this.SnapshotName, ref variables);
snapshotName = variables[0].Value as string;
variables.Unlock();

From what you're saying though you don't know in advance what variables you want to lock, and that is a problem. There is no way to just ask for a list of all variables. I assume your pseudo config item and the variable name match, so at best you can loop through the config items and ask if a variable of that name exists, using the VariableDispenser.Contains method. If found then lock it and do what you want, but you cannot just eneumerate a collection of all variables in the package to find out what is there.

|||Hi DarrenSQLIS,

Yeah, you're right! My pseudo config item and the variable name match so I can loop through the config items and that's what I did. I wasn't understanding the purpose of the GetVariables() method of VariablesDispenser. After I played with it some time I realized it copies the variables from the package that you lock (read-only or r/w) before to the Variables collection that you pass by reference. Then you can access the variables from this collection and set them. What I don't understand completely is how the variables are return to the package or VariablesDispenser. I'm guessing is after you unlock them.

Well, thank you so much for your tips/ideas/suggestions. I finally finished building my Custom Task as I wanted. It's a shame you cannot access all the variables without knowing the name of the variables ahead. In this case I'm assuming that whatever is in the package is also in the config file but my process will fail if the package has a variable that the config file doesn't.sql

Custom Task w/ runtime user interaction

I've been playing around with building custom components for SSIS. I've been doing workflow for years (using Java and Oracle). The company I worked for had a framework for publishing data that allowed for user interaction. That's something I'd love to be able to do in SSIS.

Is it possible to create a custom task that interacts with the user at runtime? So, the user starts the SSIS package. At some point, the process pops up a dialog (Windows Form) that asks the user to set a date using a calendar control.

Any thoughts?

Is it possible? Yes. Is it recommended? No. SSIS is really designed for batch, non-interactive applications. It would be much better to write a custom app that gathers all the user input in the beginning, and then launches the SSIS package, setting any necessary variables based on the user input at that point.|||

That sounds like a great plan...only I cannot figure out a way to do that which does not require writing an entire program, figuring out a way to store the variable in a file, or somehow PASS it to the SQL SSIS Package, and I have NO IDEA how to do that.

I have the EXACT same need as the person who asked you the question, and I'd be happy with manually entering the date one character at a time. The SSIS Package I am writing pulls special information from a database and places it in a text file with fixed widths. I have everythign on this working perfectly. The problem is that Every three Months - I have to write it again from scratch because the starting date changes.

i just want the simplest way to enter a NEW Starting Date (even if that means storing it somewhere on a file server), and run the Agent using the SSIS Package to make it work.

My Perfect Solution would be a THREE STEP Agent, with Step One getting the variable and passing it to step 2, Step 2 being the query I have now importing the date it got from step one, and step three being the notify portion when it is done.

I can find NO USEDUL INFORMATION on how to do this...or maybe I just don't get it.

|||

For that, I would define a variable in the Package to hold the start date. Then use DTEXEC with the /SET switch, which allows you to set a variable's value from the command line. Agent can run DTEXEC, passing it the /SET value.

Another option would be to store the date in a table on your database, and read it into the package using an Execute SQL task.

Since you are running this from Agent, you really don't want a UI, since no user will be there to respond to it.

Custom Task w/ runtime user interaction

I've been playing around with building custom components for SSIS. I've been doing workflow for years (using Java and Oracle). The company I worked for had a framework for publishing data that allowed for user interaction. That's something I'd love to be able to do in SSIS.

Is it possible to create a custom task that interacts with the user at runtime? So, the user starts the SSIS package. At some point, the process pops up a dialog (Windows Form) that asks the user to set a date using a calendar control.

Any thoughts?

Is it possible? Yes. Is it recommended? No. SSIS is really designed for batch, non-interactive applications. It would be much better to write a custom app that gathers all the user input in the beginning, and then launches the SSIS package, setting any necessary variables based on the user input at that point.|||

That sounds like a great plan...only I cannot figure out a way to do that which does not require writing an entire program, figuring out a way to store the variable in a file, or somehow PASS it to the SQL SSIS Package, and I have NO IDEA how to do that.

I have the EXACT same need as the person who asked you the question, and I'd be happy with manually entering the date one character at a time. The SSIS Package I am writing pulls special information from a database and places it in a text file with fixed widths. I have everythign on this working perfectly. The problem is that Every three Months - I have to write it again from scratch because the starting date changes.

i just want the simplest way to enter a NEW Starting Date (even if that means storing it somewhere on a file server), and run the Agent using the SSIS Package to make it work.

My Perfect Solution would be a THREE STEP Agent, with Step One getting the variable and passing it to step 2, Step 2 being the query I have now importing the date it got from step one, and step three being the notify portion when it is done.

I can find NO USEDUL INFORMATION on how to do this...or maybe I just don't get it.

|||

For that, I would define a variable in the Package to hold the start date. Then use DTEXEC with the /SET switch, which allows you to set a variable's value from the command line. Agent can run DTEXEC, passing it the /SET value.

Another option would be to store the date in a table on your database, and read it into the package using an Execute SQL task.

Since you are running this from Agent, you really don't want a UI, since no user will be there to respond to it.

Custom Task Properties

So I've built my own custom task and it has a selection of properties.
I drop it onto designer and can see the properties (VS Property Grid not custom UI ).

The properties window retracts and I decide to reopen the property window. My Properties have now disappeared (mine - not inherted). Never do they return for that instance of the task. add another task and we can see the second instance's properties but suffer the same fate as with #1 when we want to see them on > 1 occasion.

I can see the properties in Expressions which leads me to think the task is correct and it is a VS grid thing.

Jamie, Myself and Darren have experienced differing but similar issues with properties of various objects (variables/Tasks) and being able to see the values etc.

Is this an issue you are aware of internally?

Thanks

Allan

We've seen similar issues in the past. Since it's not happening with the stock tasks (or is it?) I would question if it's the grid...
Hard to say without having the task or some other repro of the problem.
Do you see this with other tasks besides your custom tasks?
K

|||Hey Kirk.

No this does not happen with the STOCK stuff. Are any of your Tasks managed code? I can post you the task if you want as it is driving me nuts.

Thanks

Allan|||Yes, many of the stock tasks are managed. So, sure, why don't you open a bug and put the code into the bug. We'll take a look.
Thanks,|||Here you go Kirk

842978484 on BetaPlace
Allan|||Did anyone discover any resolution to this? I am experiencing the exact same thing....sql

Custom Task deployment

Hi all,

I'm having a nightmare trying to test my custom task.

I get the following error message when trying to add the task from the toolbox...

Cannot create a task with the name "myTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b8e53511af163eb7". Verify that the name is correct.
(Package)


Program Location:

at Microsoft.SqlServer.Dts.Runtime.Executables.Add(String moniker)
at Microsoft.DataTransformationServices.Design.DtsBasePackageDesigner.CreateExecutable(String moniker, IDTSSequence container, String name)

Any ideas?

Cheers.

Is the task registered in the GAC? Also, it has to be copied to your Program Files\Microsoft SQL Server\90\DTS\Tasks folder (sounds like you have already done that).

Have you signed the component? Again, sounds like you have already done this, just covering the bases.

|||

Hi,

thanks for your response, but yeah it turns up in the toolbox so I had to sign it and GAC it to get to that stage.

I've done everything that is supposed to be required to get it working so I'm just out of ideas now.

Cheers.

|||

Sorted it now, turns out you have to GAC all assemblies referenced by the task not just the task itself.

Silly me.

Custom Task Deployment

Hello All,

We have developed some custom tasks which we currently deploy the standard way. That is, we install the custom task assemblies in the DTS\Tasks folder and we also install the assemblies in the GAC. Due to some deployment practices we are trying to implement we would like to be able to remove the assemblies from the GAC and install them in some other location. I have tried installing the assemblies in the DTS\Binn folder, but this does not appear to be working. When I drop the custom control flow tasks onto the package's control flow tab I get the "Cannot create a task with the name ..." error.

Is it possible to not have the custom task assemblies in the GAC? Are there any tricks to getting it to work?

FYI, our assemblies are signed. I'm not sure if that has anything to do with our troubles.

Thanks,

Rob

1234123412 wrote:

Hello All,

We have developed some custom tasks which we currently deploy the standard way. That is, we install the custom task assemblies in the DTS\Tasks folder and we also install the assemblies in the GAC. Due to some deployment practices we are trying to implement we would like to be able to remove the assemblies from the GAC and install them in some other location. I have tried installing the assemblies in the DTS\Binn folder, but this does not appear to be working. When I drop the custom control flow tasks onto the package's control flow tab I get the "Cannot create a task with the name ..." error.

Is it possible to not have the custom task assemblies in the GAC? Are there any tricks to getting it to work?

FYI, our assemblies are signed. I'm not sure if that has anything to do with our troubles.

Thanks,

Rob

Unfortunately (for you) they are required to be in the GAC.

-Jamie

|||

It makes sense (standard .Net assembly loader stuff), and as indicated in the post below , the assemblies can be loaded from the execution host directory as well. It is not documented, and probably not supported either. I know that the designer uses the DTS\ObjectType folders, so have you tried it in DTS\Task and DTS\Binn at the same time? If so and it still does not work, then why not try the supported/documented method ;) In theory the designer only requires the DLL in the DTS\Task folder, the GAC is used at runtime.

The only other reason for the error, is that the assembly you are trying to add, as stored in the toolbox "metadata" is no longer the assembly you actually have. Maybe clearing out the toolbox will help. If you changed the strong name, then you will have to fix up any packages and also sort out the toolbox.

Re: Custom SSIS Task Deployment - MSDN Forums
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=803910&SiteID=1)

Why not install them in the GAC as usual?

|||

Our issue is that we have several data access layer assemblies which are shared by our custom tasks and some web applications. The problem is that on several of our developer machines we are having build problems when building the web applications. We get error messages when we try to register the assemblies in the GAC. It has something to do with the ASP.Net worker process "locking" the assemblies even though the web application isn't running.

I haven't been able to get the custom tasks to work if they aren't in the GAC, but since the web application/GAC issue is just with the DAL assemblies it is really the DAL assemblies that we want to avoid putting in the GAC. I am able to put the DAL assemblies in the DTS\binn directory and keep the custom task assemblies in the GAC. This solves our problem.

Thanks for your repsonses.

Custom task database connection

I'm developing a custom error task for SSIS. I've got a couple of existing OLE DB connections that exist in the Connection Manager. I want a drop down to be displayed in the Custom Task dialogue properties where the user can select one of the databases from the Connection manager.

2 questions:
1. How can i get the list of OLE DB databases in the properties dialogue?
2. Does anyone have a code sample on accessing a database like that within the custom component?Try this post http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=122993&SiteID=1

I don't think you can use an OLE-DB connection directly in managed code. You may (I haven't tried) be able to read off the connection string and use that to create your own ADO.net connection. I have been using ADO.Net connections myself, normally SQL, which gives you a SqlClient.SqlConnection object.

|||Hi Darren,

I don't understand how the IDtsTaskUI.Initialize one ties in here? Also, do you have to tie in the connections within the Acquire Connection method?|||If you have a custom UI for your task then you will have implemented IDtsTaskUI.Initialize in the class that implements IDtsTaskUI.

You call AcquireConnection on the connection you want to get the real connection object. For a file connection that is just a string of the filename, for an ADO.NET connection type SQL, that is a SqlConnection. You would call this in your UI, and also at run-time in the Execute method.

Custom Task and Reading Package Configuration

Hello All,

I have searched on this forum for a similar question but couldn't find it so I apologize if this has been asked. If so, I'd greatly appreciate a link to the question. I have created a custom task and am trying to read an xml package configuration file within my custom task. To be more specific, I have added an ADO.Net Connection to my database onto the package and have generated the appropriate tags within my package's configuration xml file. I'm not seeing the classes I should use to access the configuration file of the package I've created. Does anybody have any ideas how I can accomplish this or a link to a document that might cover the material? Thanks!

Jay_G

Jay,

First, let's be sure that what you're trying to do is what you really want to do.

Why do you want to read the configuration? Are you trying to do something with the configuration or do you simply want your custom task to be configured?

|||

Hello Kirk,

Thank you for responding. My custom task will, at times, need to read from a database and I figured the standard database connection string parameters would all be within the configuration file. I initially thought that I would need to use a package connection but the original intent of this custom task is be as easy to use and seemless as possible (meaning drop the task on the designer, set a few properties and be done). The custom task will be used over and over again within many packages. We didn't want to make all of our package developers have to configure a connection for this task but maybe this approach doesn't make sense. Does that make sense or should I be doing it a different way? I'm very new to SSIS and very much open to suggestions. Let me know if you need more clarification. Thanks again.

Jay_G

Custom Task - Custom Property Expression

I am writing a custom task that has some custom properties. I would like to parameterize these properties i.e. read from a varaible, so I can change these variables from a config file during runtime.

I read the documentation and it says if we set the ExpressionType to CPET_NOTIFY, it should work, but it does not seem to work. Not sure if I am missing anything. Can someone please help me?

This is what I did in the custom task

customProperty.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;

In the Editor of my custom task, under custom properties section, I expected a button with 3 dots, to click & pop-up so we can specify the expression or at least so it evaluates the variables if we give @.[User::VaraibleName]

Any help on this will be very much appreciated.

Thanks

Are you by chance actually referring to a Custom DataFlow Component? If so, the expressionable properties actually show up on the DataFlow Task container. To edit the expressions, select the DataFlow and open properties. Find the Expressions property and open the Property Expressions Editor. You should see your custom component's expressionable properties in the Property dropdown.

Let me know if this answers your question.

Thanks
Mark

|||Thanks, got it. I tried the same earlier, but did not drag & drop my new component after the change.sql

Tuesday, March 20, 2012

Custom SSIS Task Deployment

I've written several custom Control Flow and Data Flow components for SSIS. I'm trying to deploy a new Control Flow Task, however it will not show up in the "Choose Toolbox Items" window.

I have my dll's all in the right place. Because of other painful issues we have not used the GAC, and instead have put our DLL's that are referenced in the following directory: C:\program files\Microsoft SQL Server\90\DTS\Binn. This has worked fine for other custom tasks, but not for this one.

The only things that are different about this transform are the following:

1. Not only does the task inherit from Task, it also implements two interfaces that I wrote.

2. One of the assembly references is actualy an executable instead of a dll. This is unusual, but I've done it with other .NET projects and not had any trouble.

I could move the code I need from the EXE out to a DLL. If somebody knows what could be causing this please respond?

Is your task in C:\Program Files\Microsoft SQL Server\90\DTS\Tasks ? That is where the Choose Toolbox Items looks for task, or just Reset Toolbox and it will add/remove according to the valid tasks it finds in that folder.|||My task dll is in the C:\Program Files\Microsoft SQL Server\90\DTS\Tasks folder. The difference is the dll's it references are usually placed in the DTS\Binn folder. However for some reason when I added this particular task it didn't look in the Binn folder instead it looked in the Tasks folder for it's supporting dll's. When I added the supporting dll's to the Tasks folder it showed up fine in the choose toolbox items list. I'm not sure what is different from my other tasks and this one that would require the referenced dll's to be in the same folder?|||In turns out the problem didn't have to do with either the EXE or the interface implementation. When we referenced code in our other custom tasks it was only locals inside Task methods. However this time since I was implementing an interface as part of a task it needed the referenced dll's at the time Visual Studio retrieves the list of tasks. So in addition to having the referenced dll's in the DTS/Binn folder I needed them in the DTS/Tasks folder as well.

Custom SSIS Task Deployment

I've written several custom Control Flow and Data Flow components for SSIS. I'm trying to deploy a new Control Flow Task, however it will not show up in the "Choose Toolbox Items" window.

I have my dll's all in the right place. Because of other painful issues we have not used the GAC, and instead have put our DLL's that are referenced in the following directory: C:\program files\Microsoft SQL Server\90\DTS\Binn. This has worked fine for other custom tasks, but not for this one.

The only things that are different about this transform are the following:

1. Not only does the task inherit from Task, it also implements two interfaces that I wrote.

2. One of the assembly references is actualy an executable instead of a dll. This is unusual, but I've done it with other .NET projects and not had any trouble.

I could move the code I need from the EXE out to a DLL. If somebody knows what could be causing this please respond?

Is your task in C:\Program Files\Microsoft SQL Server\90\DTS\Tasks ? That is where the Choose Toolbox Items looks for task, or just Reset Toolbox and it will add/remove according to the valid tasks it finds in that folder.|||My task dll is in the C:\Program Files\Microsoft SQL Server\90\DTS\Tasks folder. The difference is the dll's it references are usually placed in the DTS\Binn folder. However for some reason when I added this particular task it didn't look in the Binn folder instead it looked in the Tasks folder for it's supporting dll's. When I added the supporting dll's to the Tasks folder it showed up fine in the choose toolbox items list. I'm not sure what is different from my other tasks and this one that would require the referenced dll's to be in the same folder?|||In turns out the problem didn't have to do with either the EXE or the interface implementation. When we referenced code in our other custom tasks it was only locals inside Task methods. However this time since I was implementing an interface as part of a task it needed the referenced dll's at the time Visual Studio retrieves the list of tasks. So in addition to having the referenced dll's in the DTS/Binn folder I needed them in the DTS/Tasks folder as well.sql

Thursday, March 8, 2012

custom identity field

I have what I thought would be a simple task but I keep hitting dead ends.
My database has many tables, each with an identity column as the primary
key. This worked fine until we had a requirement to import rows from other
sites/database installs (same tables, different servers). We won't have
very many databases, but the table keys must be unique to the database and
the sites. Since our users refer to the rows by ID, GUIDs are far too
awkward and will not work. The key needs to work much like the identity
field, easy to query the last key added and the key is generated
automagically.
The easy solution would be to just add the site code (3 letter alpha) to the
keys. We had hoped to just create a simple function that would return the
key and we could set the default value of the key to point to the function.
For example, the table User would have a primary key of UserID with a
default value of getKey('user') which would return 'AAA1' for the first user
entered in site 'AAA'. If the first user from site 'BBB' was imported, it
would be simple to synchronize and determine at a glance as we would have a
user 'BBB1'.
After playing around with functions, procs, default values, creating system
functions, formulas, triggers, we have not found a way to do what we want.
Anybody have any advice on this? Is there a better way?
Don't use IDENTITY keys to maintain integrity between databases - it's a
waste of time. Use alternate keys for that. The only sensible use of an
IDENTITY key is as a SURROGATE so just assign new IDENTITY keys (parent and
foreign keys) when you import the data.
David Portas
SQL Server MVP
|||>> "Don't use IDENTITY keys...Use alternate keys..."
That is exactly my question. I stated that I cannot use IDENTITY keys and
want to create my own alternate key. How can I generate an alternate key
that can, as seemlessly as possible, replace the IDENTITY key? I've tried
to create system functions, triggers, and procs but cannot seem to find a
mechanism whereby I can autogenerate a default value for the row based on a
procedure call.
|||I don't see a problem. Your tables on the source systems should already
have alternate keys because IDENTITY should never be the only key of a
table. So if you need to preserve potential duplicates between the two
systems just add another column to make up a compound key. The
additional column identifies the source as "A", "B", "C" or whatever.
Why go to the trouble of putting it into one single column? You can
always concatenate the key as one in a view if you need to.
David Portas
SQL Server MVP
|||An example is worth a thousand words so here's how I would do it.
The two sites, A and B:
CREATE TABLE A_foo (x INTEGER IDENTITY PRIMARY KEY, z CHAR(10) NOT NULL
UNIQUE)
CREATE TABLE A_bar (x INTEGER NOT NULL REFERENCES A_foo (x), k CHAR(10)
NOT NULL, PRIMARY KEY (x,k))
CREATE TABLE B_foo (x INTEGER IDENTITY PRIMARY KEY, z CHAR(10) NOT NULL
UNIQUE)
CREATE TABLE B_bar (x INTEGER NOT NULL REFERENCES B_foo (x), k CHAR(10)
NOT NULL, PRIMARY KEY (x,k))
Generate some sample data:
INSERT INTO A_foo (z)
SELECT 'Alpha' UNION ALL
SELECT 'Beta'
INSERT INTO A_bar (x,k)
SELECT 1,'XXX' UNION ALL
SELECT 1,'YYY' UNION ALL
SELECT 2,'XXX' UNION ALL
SELECT 2,'ZZZ'
INSERT INTO B_foo (z)
SELECT 'Alpha' UNION ALL
SELECT 'Beta'
INSERT INTO B_bar (x,k)
SELECT 1,'111' UNION ALL
SELECT 1,'222' UNION ALL
SELECT 2,'111' UNION ALL
SELECT 2,'333'
These are the two tables for the merged data:
CREATE TABLE foo (x INTEGER IDENTITY PRIMARY KEY, source CHAR(1) NOT
NULL, z CHAR(10) NOT NULL, UNIQUE (source,z))
CREATE TABLE bar (x INTEGER NOT NULL REFERENCES foo (x), k CHAR(10) NOT
NULL, PRIMARY KEY (x,k))
Now do the merge:
INSERT INTO foo (source, z)
SELECT 'A', z
FROM A_foo
UNION ALL
SELECT 'B', z
FROM B_foo
INSERT INTO bar (x,k)
SELECT foo.x, A_bar.k
FROM A_bar
JOIN A_foo
ON A_foo.x = A_bar.x
JOIN foo
ON A_foo.z = foo.z
AND foo.source = 'A'
UNION ALL
SELECT foo.x, B_bar.k
FROM B_bar
JOIN B_foo
ON B_foo.x = B_bar.x
JOIN foo
ON B_foo.z = foo.z
AND foo.source = 'B'
You'll probably want to add a WHERE NOT EXISTS condition to the INSERTs
to ensure that only new data gets loaded.
David Portas
SQL Server MVP

custom identity field

I have what I thought would be a simple task but I keep hitting dead ends.
My database has many tables, each with an identity column as the primary
key. This worked fine until we had a requirement to import rows from other
sites/database installs (same tables, different servers). We won't have
very many databases, but the table keys must be unique to the database and
the sites. Since our users refer to the rows by ID, GUIDs are far too
awkward and will not work. The key needs to work much like the identity
field, easy to query the last key added and the key is generated
automagically.
The easy solution would be to just add the site code (3 letter alpha) to the
keys. We had hoped to just create a simple function that would return the
key and we could set the default value of the key to point to the function.
For example, the table User would have a primary key of UserID with a
default value of getKey('user') which would return 'AAA1' for the first user
entered in site 'AAA'. If the first user from site 'BBB' was imported, it
would be simple to synchronize and determine at a glance as we would have a
user 'BBB1'.
After playing around with functions, procs, default values, creating system
functions, formulas, triggers, we have not found a way to do what we want.
Anybody have any advice on this? Is there a better way?Don't use IDENTITY keys to maintain integrity between databases - it's a
waste of time. Use alternate keys for that. The only sensible use of an
IDENTITY key is as a SURROGATE so just assign new IDENTITY keys (parent and
foreign keys) when you import the data.
David Portas
SQL Server MVP
--|||>> "Don't use IDENTITY keys...Use alternate keys..."
That is exactly my question. I stated that I cannot use IDENTITY keys and
want to create my own alternate key. How can I generate an alternate key
that can, as seemlessly as possible, replace the IDENTITY key? I've tried
to create system functions, triggers, and procs but cannot seem to find a
mechanism whereby I can autogenerate a default value for the row based on a
procedure call.|||I don't see a problem. Your tables on the source systems should already
have alternate keys because IDENTITY should never be the only key of a
table. So if you need to preserve potential duplicates between the two
systems just add another column to make up a compound key. The
additional column identifies the source as "A", "B", "C" or whatever.
Why go to the trouble of putting it into one single column? You can
always concatenate the key as one in a view if you need to.
David Portas
SQL Server MVP
--|||An example is worth a thousand words so here's how I would do it.
The two sites, A and B:
CREATE TABLE A_foo (x INTEGER IDENTITY PRIMARY KEY, z CHAR(10) NOT NULL
UNIQUE)
CREATE TABLE A_bar (x INTEGER NOT NULL REFERENCES A_foo (x), k CHAR(10)
NOT NULL, PRIMARY KEY (x,k))
CREATE TABLE B_foo (x INTEGER IDENTITY PRIMARY KEY, z CHAR(10) NOT NULL
UNIQUE)
CREATE TABLE B_bar (x INTEGER NOT NULL REFERENCES B_foo (x), k CHAR(10)
NOT NULL, PRIMARY KEY (x,k))
Generate some sample data:
INSERT INTO A_foo (z)
SELECT 'Alpha' UNION ALL
SELECT 'Beta'
INSERT INTO A_bar (x,k)
SELECT 1,'XXX' UNION ALL
SELECT 1,'YYY' UNION ALL
SELECT 2,'XXX' UNION ALL
SELECT 2,'ZZZ'
INSERT INTO B_foo (z)
SELECT 'Alpha' UNION ALL
SELECT 'Beta'
INSERT INTO B_bar (x,k)
SELECT 1,'111' UNION ALL
SELECT 1,'222' UNION ALL
SELECT 2,'111' UNION ALL
SELECT 2,'333'
These are the two tables for the merged data:
CREATE TABLE foo (x INTEGER IDENTITY PRIMARY KEY, source CHAR(1) NOT
NULL, z CHAR(10) NOT NULL, UNIQUE (source,z))
CREATE TABLE bar (x INTEGER NOT NULL REFERENCES foo (x), k CHAR(10) NOT
NULL, PRIMARY KEY (x,k))
Now do the merge:
INSERT INTO foo (source, z)
SELECT 'A', z
FROM A_foo
UNION ALL
SELECT 'B', z
FROM B_foo
INSERT INTO bar (x,k)
SELECT foo.x, A_bar.k
FROM A_bar
JOIN A_foo
ON A_foo.x = A_bar.x
JOIN foo
ON A_foo.z = foo.z
AND foo.source = 'A'
UNION ALL
SELECT foo.x, B_bar.k
FROM B_bar
JOIN B_foo
ON B_foo.x = B_bar.x
JOIN foo
ON B_foo.z = foo.z
AND foo.source = 'B'
You'll probably want to add a WHERE NOT EXISTS condition to the INSERTs
to ensure that only new data gets loaded.
David Portas
SQL Server MVP
--

custom identity field

I have what I thought would be a simple task but I keep hitting dead ends.
My database has many tables, each with an identity column as the primary
key. This worked fine until we had a requirement to import rows from other
sites/database installs (same tables, different servers). We won't have
very many databases, but the table keys must be unique to the database and
the sites. Since our users refer to the rows by ID, GUIDs are far too
awkward and will not work. The key needs to work much like the identity
field, easy to query the last key added and the key is generated
automagically.
The easy solution would be to just add the site code (3 letter alpha) to the
keys. We had hoped to just create a simple function that would return the
key and we could set the default value of the key to point to the function.
For example, the table User would have a primary key of UserID with a
default value of getKey('user') which would return 'AAA1' for the first user
entered in site 'AAA'. If the first user from site 'BBB' was imported, it
would be simple to synchronize and determine at a glance as we would have a
user 'BBB1'.
After playing around with functions, procs, default values, creating system
functions, formulas, triggers, we have not found a way to do what we want.
Anybody have any advice on this? Is there a better way?Don't use IDENTITY keys to maintain integrity between databases - it's a
waste of time. Use alternate keys for that. The only sensible use of an
IDENTITY key is as a SURROGATE so just assign new IDENTITY keys (parent and
foreign keys) when you import the data.
--
David Portas
SQL Server MVP
--|||>> "Don't use IDENTITY keys...Use alternate keys..."
That is exactly my question. I stated that I cannot use IDENTITY keys and
want to create my own alternate key. How can I generate an alternate key
that can, as seemlessly as possible, replace the IDENTITY key? I've tried
to create system functions, triggers, and procs but cannot seem to find a
mechanism whereby I can autogenerate a default value for the row based on a
procedure call.|||I don't see a problem. Your tables on the source systems should already
have alternate keys because IDENTITY should never be the only key of a
table. So if you need to preserve potential duplicates between the two
systems just add another column to make up a compound key. The
additional column identifies the source as "A", "B", "C" or whatever.
Why go to the trouble of putting it into one single column? You can
always concatenate the key as one in a view if you need to.
--
David Portas
SQL Server MVP
--|||An example is worth a thousand words so here's how I would do it.
The two sites, A and B:
CREATE TABLE A_foo (x INTEGER IDENTITY PRIMARY KEY, z CHAR(10) NOT NULL
UNIQUE)
CREATE TABLE A_bar (x INTEGER NOT NULL REFERENCES A_foo (x), k CHAR(10)
NOT NULL, PRIMARY KEY (x,k))
CREATE TABLE B_foo (x INTEGER IDENTITY PRIMARY KEY, z CHAR(10) NOT NULL
UNIQUE)
CREATE TABLE B_bar (x INTEGER NOT NULL REFERENCES B_foo (x), k CHAR(10)
NOT NULL, PRIMARY KEY (x,k))
Generate some sample data:
INSERT INTO A_foo (z)
SELECT 'Alpha' UNION ALL
SELECT 'Beta'
INSERT INTO A_bar (x,k)
SELECT 1,'XXX' UNION ALL
SELECT 1,'YYY' UNION ALL
SELECT 2,'XXX' UNION ALL
SELECT 2,'ZZZ'
INSERT INTO B_foo (z)
SELECT 'Alpha' UNION ALL
SELECT 'Beta'
INSERT INTO B_bar (x,k)
SELECT 1,'111' UNION ALL
SELECT 1,'222' UNION ALL
SELECT 2,'111' UNION ALL
SELECT 2,'333'
These are the two tables for the merged data:
CREATE TABLE foo (x INTEGER IDENTITY PRIMARY KEY, source CHAR(1) NOT
NULL, z CHAR(10) NOT NULL, UNIQUE (source,z))
CREATE TABLE bar (x INTEGER NOT NULL REFERENCES foo (x), k CHAR(10) NOT
NULL, PRIMARY KEY (x,k))
Now do the merge:
INSERT INTO foo (source, z)
SELECT 'A', z
FROM A_foo
UNION ALL
SELECT 'B', z
FROM B_foo
INSERT INTO bar (x,k)
SELECT foo.x, A_bar.k
FROM A_bar
JOIN A_foo
ON A_foo.x = A_bar.x
JOIN foo
ON A_foo.z = foo.z
AND foo.source = 'A'
UNION ALL
SELECT foo.x, B_bar.k
FROM B_bar
JOIN B_foo
ON B_foo.x = B_bar.x
JOIN foo
ON B_foo.z = foo.z
AND foo.source = 'B'
You'll probably want to add a WHERE NOT EXISTS condition to the INSERTs
to ensure that only new data gets loaded.
--
David Portas
SQL Server MVP
--

Saturday, February 25, 2012

Custom connection manager development sample?

Does anyone has code/sample/tutorial/pointer to developing custom connection manager with a custom UI. And then developing a custom task with a custom UI that can point to this custom connection manager... and passing values during runtime from UI to the custom class.

TIA,
NiteshThe first updated Web release of BOL will contain one sample that works with SQL Server and simply asks for server name...a kind of "Hello World" version of what you're asking for.

The second Web release next spring will contain a second sample, a replacement Excel connection manager that includes a checkbox for Import Mode to resolve the common "mixed data types" issue.

The code is too long to post in the forum, but if you'll provide an email address, I can send you one or both.

It's pleasantly simple, relatively speaking, the the UI methods are almost identical from task to data flow component to connection manager, so what you learn will also be portable.

-Doug
|||Okay, I see that you have provided an email address. I'll send them along.
|||Hi DouglasL,
Can you also send me those samples? I am looking for ways to develop a custom connection manager in SSIS and the samples you mention would be extremely helpful. Please use my email address without the .(dontspamme) at the end.

Thanks,
Milen|||

Doug, will you please send me the sample as well? My email is svandekrol [at] taic [dot] net

Thanks

|||

Hi, Doug

I'm also trying to create a custom connection manager, so a sample would be really helpful.

Could you please send to: tminorway [at] hotmail [dot] com ?

Thanks,

Thomas

|||

Doug,

I'm interested in the code, too... Just because the Excel import is sometimes a real pain... Perhaps you ask some of your collegues with blogs to post it there or maybe I can do that for you...

|||Hi Doug:

Thanks for your reply to my other question regarding "setting the data source of data flow from external app". I am also very interested in knowing how to do the custom connection manager, could you please send me a copy of the sample too? My email address is mding1 [at] hotmail [dot] com.

Thanks,
Ming
|||Hi Doug,

I'm interested in the sample code, too. We plan to develop some custom connections.

Thanks in advance.
Fridtjof
mailto:fw[at]team4[dot]de
|||

My apologies to all whose requests I've overlooked...I've been having trouble with the Alerts from the forums. I will send samples today.

-Doug

|||

Can you send me the samples too ?

Mailto : peter.ang[at]comcast.net

|||

I would also like these.

Thank You
hcunningham[at]guideone.com

|||

I will also Like have a look At the Code.

There is a sample also Provided at http://msdn2.microsoft.com/en-us/library/ms345276.aspx

Please any one Zip the code and mail at dharmbirk@.aztec.soft.net

Thanks

Dharmbir

|||

Hi Doug,

The sample contains a Sample Ado source. How would i call a custom editor instead of Advanced Editor. Can you point me any help on that.

Thanks

Dharmbir

|||

I assume you mean a custom UI for the component not connection. You follow a similar pattern to tasks, but inherit from IDtsComponentUI Interface.

Developing a User Interface for Components
(ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/dtsref9/html/10b829a1-609b-42e3-9070-cfe5a2bb698c.htm)

A sample is available from here, Ch 14 & 15 - Wrox::Professional SQL Server 2005 Integration Services:Book Information and Code Download
(http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359,descCd-download_code.html)

Custom connection manager development sample?

Does anyone has code/sample/tutorial/pointer to developing custom connection manager with a custom UI. And then developing a custom task with a custom UI that can point to this custom connection manager... and passing values during runtime from UI to the custom class.

TIA,
NiteshThe first updated Web release of BOL will contain one sample that works with SQL Server and simply asks for server name...a kind of "Hello World" version of what you're asking for.

The second Web release next spring will contain a second sample, a replacement Excel connection manager that includes a checkbox for Import Mode to resolve the common "mixed data types" issue.

The code is too long to post in the forum, but if you'll provide an email address, I can send you one or both.

It's pleasantly simple, relatively speaking, the the UI methods are almost identical from task to data flow component to connection manager, so what you learn will also be portable.

-Doug|||Okay, I see that you have provided an email address. I'll send them along.|||Hi DouglasL,
Can you also send me those samples? I am looking for ways to develop a custom connection manager in SSIS and the samples you mention would be extremely helpful. Please use my email address without the .(dontspamme) at the end.

Thanks,
Milen|||

Doug, will you please send me the sample as well? My email is svandekrol [at] taic [dot] net

Thanks

|||

Hi, Doug

I'm also trying to create a custom connection manager, so a sample would be really helpful.

Could you please send to: tminorway [at] hotmail [dot] com ?

Thanks,

Thomas

|||

Doug,

I'm interested in the code, too... Just because the Excel import is sometimes a real pain... Perhaps you ask some of your collegues with blogs to post it there or maybe I can do that for you...

|||Hi Doug:

Thanks for your reply to my other question regarding "setting the data source of data flow from external app". I am also very interested in knowing how to do the custom connection manager, could you please send me a copy of the sample too? My email address is mding1 [at] hotmail [dot] com.

Thanks,
Ming|||Hi Doug,

I'm interested in the sample code, too. We plan to develop some custom connections.

Thanks in advance.
Fridtjof
mailto:fw[at]team4[dot]de

|||

My apologies to all whose requests I've overlooked...I've been having trouble with the Alerts from the forums. I will send samples today.

-Doug

|||

Can you send me the samples too ?

Mailto : peter.ang[at]comcast.net

|||

I would also like these.

Thank You
hcunningham[at]guideone.com

|||

I will also Like have a look At the Code.

There is a sample also Provided at http://msdn2.microsoft.com/en-us/library/ms345276.aspx

Please any one Zip the code and mail at dharmbirk@.aztec.soft.net

Thanks

Dharmbir

|||

Hi Doug,

The sample contains a Sample Ado source. How would i call a custom editor instead of Advanced Editor. Can you point me any help on that.

Thanks

Dharmbir

|||

I assume you mean a custom UI for the component not connection. You follow a similar pattern to tasks, but inherit from IDtsComponentUI Interface.

Developing a User Interface for Components
(ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/dtsref9/html/10b829a1-609b-42e3-9070-cfe5a2bb698c.htm)

A sample is available from here, Ch 14 & 15 - Wrox::Professional SQL Server 2005 Integration Services:Book Information and Code Download
(http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359,descCd-download_code.html)

Custom connection manager development sample?

Does anyone has code/sample/tutorial/pointer to developing custom connection manager with a custom UI. And then developing a custom task with a custom UI that can point to this custom connection manager... and passing values during runtime from UI to the custom class.

TIA,
NiteshThe first updated Web release of BOL will contain one sample that works with SQL Server and simply asks for server name...a kind of "Hello World" version of what you're asking for.

The second Web release next spring will contain a second sample, a replacement Excel connection manager that includes a checkbox for Import Mode to resolve the common "mixed data types" issue.

The code is too long to post in the forum, but if you'll provide an email address, I can send you one or both.

It's pleasantly simple, relatively speaking, the the UI methods are almost identical from task to data flow component to connection manager, so what you learn will also be portable.

-Doug|||Okay, I see that you have provided an email address. I'll send them along.|||Hi DouglasL,
Can you also send me those samples? I am looking for ways to develop a custom connection manager in SSIS and the samples you mention would be extremely helpful. Please use my email address without the .(dontspamme) at the end.

Thanks,
Milen|||

Doug, will you please send me the sample as well? My email is svandekrol [at] taic [dot] net

Thanks

|||

Hi, Doug

I'm also trying to create a custom connection manager, so a sample would be really helpful.

Could you please send to: tminorway [at] hotmail [dot] com ?

Thanks,

Thomas

|||

Doug,

I'm interested in the code, too... Just because the Excel import is sometimes a real pain... Perhaps you ask some of your collegues with blogs to post it there or maybe I can do that for you...

|||Hi Doug:

Thanks for your reply to my other question regarding "setting the data source of data flow from external app". I am also very interested in knowing how to do the custom connection manager, could you please send me a copy of the sample too? My email address is mding1 [at] hotmail [dot] com.

Thanks,
Ming|||Hi Doug,

I'm interested in the sample code, too. We plan to develop some custom connections.

Thanks in advance.
Fridtjof
mailto:fw[at]team4[dot]de

|||

My apologies to all whose requests I've overlooked...I've been having trouble with the Alerts from the forums. I will send samples today.

-Doug

|||

Can you send me the samples too ?

Mailto : peter.ang[at]comcast.net

|||

I would also like these.

Thank You
hcunningham[at]guideone.com

|||

I will also Like have a look At the Code.

There is a sample also Provided at http://msdn2.microsoft.com/en-us/library/ms345276.aspx

Please any one Zip the code and mail at dharmbirk@.aztec.soft.net

Thanks

Dharmbir

|||

Hi Doug,

The sample contains a Sample Ado source. How would i call a custom editor instead of Advanced Editor. Can you point me any help on that.

Thanks

Dharmbir

|||

I assume you mean a custom UI for the component not connection. You follow a similar pattern to tasks, but inherit from IDtsComponentUI Interface.

Developing a User Interface for Components
(ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/dtsref9/html/10b829a1-609b-42e3-9070-cfe5a2bb698c.htm)

A sample is available from here, Ch 14 & 15 - Wrox::Professional SQL Server 2005 Integration Services:Book Information and Code Download
(http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359,descCd-download_code.html)

Custom connection manager development sample?

Does anyone has code/sample/tutorial/pointer to developing custom connection manager with a custom UI. And then developing a custom task with a custom UI that can point to this custom connection manager... and passing values during runtime from UI to the custom class.

TIA,
NiteshThe first updated Web release of BOL will contain one sample that works with SQL Server and simply asks for server name...a kind of "Hello World" version of what you're asking for.

The second Web release next spring will contain a second sample, a replacement Excel connection manager that includes a checkbox for Import Mode to resolve the common "mixed data types" issue.

The code is too long to post in the forum, but if you'll provide an email address, I can send you one or both.

It's pleasantly simple, relatively speaking, the the UI methods are almost identical from task to data flow component to connection manager, so what you learn will also be portable.

-Doug
|||Okay, I see that you have provided an email address. I'll send them along.
|||Hi DouglasL,
Can you also send me those samples? I am looking for ways to develop a custom connection manager in SSIS and the samples you mention would be extremely helpful. Please use my email address without the .(dontspamme) at the end.

Thanks,
Milen|||

Doug, will you please send me the sample as well? My email is svandekrol [at] taic [dot] net

Thanks

|||

Hi, Doug

I'm also trying to create a custom connection manager, so a sample would be really helpful.

Could you please send to: tminorway [at] hotmail [dot] com ?

Thanks,

Thomas

|||

Doug,

I'm interested in the code, too... Just because the Excel import is sometimes a real pain... Perhaps you ask some of your collegues with blogs to post it there or maybe I can do that for you...

|||Hi Doug:

Thanks for your reply to my other question regarding "setting the data source of data flow from external app". I am also very interested in knowing how to do the custom connection manager, could you please send me a copy of the sample too? My email address is mding1 [at] hotmail [dot] com.

Thanks,
Ming
|||Hi Doug,

I'm interested in the sample code, too. We plan to develop some custom connections.

Thanks in advance.
Fridtjof
mailto:fw[at]team4[dot]de
|||

My apologies to all whose requests I've overlooked...I've been having trouble with the Alerts from the forums. I will send samples today.

-Doug

|||

Can you send me the samples too ?

Mailto : peter.ang[at]comcast.net

|||

I would also like these.

Thank You
hcunningham[at]guideone.com

|||

I will also Like have a look At the Code.

There is a sample also Provided at http://msdn2.microsoft.com/en-us/library/ms345276.aspx

Please any one Zip the code and mail at dharmbirk@.aztec.soft.net

Thanks

Dharmbir

|||

Hi Doug,

The sample contains a Sample Ado source. How would i call a custom editor instead of Advanced Editor. Can you point me any help on that.

Thanks

Dharmbir

|||

I assume you mean a custom UI for the component not connection. You follow a similar pattern to tasks, but inherit from IDtsComponentUI Interface.

Developing a User Interface for Components
(ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/dtsref9/html/10b829a1-609b-42e3-9070-cfe5a2bb698c.htm)

A sample is available from here, Ch 14 & 15 - Wrox::Professional SQL Server 2005 Integration Services:Book Information and Code Download
(http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359,descCd-download_code.html)

Custom connection manager development sample?

Does anyone has code/sample/tutorial/pointer to developing custom connection manager with a custom UI. And then developing a custom task with a custom UI that can point to this custom connection manager... and passing values during runtime from UI to the custom class.

TIA,
NiteshThe first updated Web release of BOL will contain one sample that works with SQL Server and simply asks for server name...a kind of "Hello World" version of what you're asking for.

The second Web release next spring will contain a second sample, a replacement Excel connection manager that includes a checkbox for Import Mode to resolve the common "mixed data types" issue.

The code is too long to post in the forum, but if you'll provide an email address, I can send you one or both.

It's pleasantly simple, relatively speaking, the the UI methods are almost identical from task to data flow component to connection manager, so what you learn will also be portable.

-Doug
|||Okay, I see that you have provided an email address. I'll send them along.
|||Hi DouglasL,
Can you also send me those samples? I am looking for ways to develop a custom connection manager in SSIS and the samples you mention would be extremely helpful. Please use my email address without the .(dontspamme) at the end.

Thanks,
Milen|||

Doug, will you please send me the sample as well? My email is svandekrol [at] taic [dot] net

Thanks

|||

Hi, Doug

I'm also trying to create a custom connection manager, so a sample would be really helpful.

Could you please send to: tminorway [at] hotmail [dot] com ?

Thanks,

Thomas

|||

Doug,

I'm interested in the code, too... Just because the Excel import is sometimes a real pain... Perhaps you ask some of your collegues with blogs to post it there or maybe I can do that for you...

|||Hi Doug:

Thanks for your reply to my other question regarding "setting the data source of data flow from external app". I am also very interested in knowing how to do the custom connection manager, could you please send me a copy of the sample too? My email address is mding1 [at] hotmail [dot] com.

Thanks,
Ming
|||Hi Doug,

I'm interested in the sample code, too. We plan to develop some custom connections.

Thanks in advance.
Fridtjof
mailto:fw[at]team4[dot]de
|||

My apologies to all whose requests I've overlooked...I've been having trouble with the Alerts from the forums. I will send samples today.

-Doug

|||

Can you send me the samples too ?

Mailto : peter.ang[at]comcast.net

|||

I would also like these.

Thank You
hcunningham[at]guideone.com

|||

I will also Like have a look At the Code.

There is a sample also Provided at http://msdn2.microsoft.com/en-us/library/ms345276.aspx

Please any one Zip the code and mail at dharmbirk@.aztec.soft.net

Thanks

Dharmbir

|||

Hi Doug,

The sample contains a Sample Ado source. How would i call a custom editor instead of Advanced Editor. Can you point me any help on that.

Thanks

Dharmbir

|||

I assume you mean a custom UI for the component not connection. You follow a similar pattern to tasks, but inherit from IDtsComponentUI Interface.

Developing a User Interface for Components
(ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/dtsref9/html/10b829a1-609b-42e3-9070-cfe5a2bb698c.htm)

A sample is available from here, Ch 14 & 15 - Wrox::Professional SQL Server 2005 Integration Services:Book Information and Code Download
(http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359,descCd-download_code.html)

Custom connection manager development sample?

Does anyone has code/sample/tutorial/pointer to developing custom connection manager with a custom UI. And then developing a custom task with a custom UI that can point to this custom connection manager... and passing values during runtime from UI to the custom class.

TIA,
NiteshThe first updated Web release of BOL will contain one sample that works with SQL Server and simply asks for server name...a kind of "Hello World" version of what you're asking for.

The second Web release next spring will contain a second sample, a replacement Excel connection manager that includes a checkbox for Import Mode to resolve the common "mixed data types" issue.

The code is too long to post in the forum, but if you'll provide an email address, I can send you one or both.

It's pleasantly simple, relatively speaking, the the UI methods are almost identical from task to data flow component to connection manager, so what you learn will also be portable.

-Doug
|||Okay, I see that you have provided an email address. I'll send them along.
|||Hi DouglasL,
Can you also send me those samples? I am looking for ways to develop a custom connection manager in SSIS and the samples you mention would be extremely helpful. Please use my email address without the .(dontspamme) at the end.

Thanks,
Milen|||

Doug, will you please send me the sample as well? My email is svandekrol [at] taic [dot] net

Thanks

|||

Hi, Doug

I'm also trying to create a custom connection manager, so a sample would be really helpful.

Could you please send to: tminorway [at] hotmail [dot] com ?

Thanks,

Thomas

|||

Doug,

I'm interested in the code, too... Just because the Excel import is sometimes a real pain... Perhaps you ask some of your collegues with blogs to post it there or maybe I can do that for you...

|||Hi Doug:

Thanks for your reply to my other question regarding "setting the data source of data flow from external app". I am also very interested in knowing how to do the custom connection manager, could you please send me a copy of the sample too? My email address is mding1 [at] hotmail [dot] com.

Thanks,
Ming
|||Hi Doug,

I'm interested in the sample code, too. We plan to develop some custom connections.

Thanks in advance.
Fridtjof
mailto:fw[at]team4[dot]de
|||

My apologies to all whose requests I've overlooked...I've been having trouble with the Alerts from the forums. I will send samples today.

-Doug

|||

Can you send me the samples too ?

Mailto : peter.ang[at]comcast.net

|||

I would also like these.

Thank You
hcunningham[at]guideone.com

|||

I will also Like have a look At the Code.

There is a sample also Provided at http://msdn2.microsoft.com/en-us/library/ms345276.aspx

Please any one Zip the code and mail at dharmbirk@.aztec.soft.net

Thanks

Dharmbir

|||

Hi Doug,

The sample contains a Sample Ado source. How would i call a custom editor instead of Advanced Editor. Can you point me any help on that.

Thanks

Dharmbir

|||

I assume you mean a custom UI for the component not connection. You follow a similar pattern to tasks, but inherit fromIDtsComponentUI Interface.

Developing a User Interface for Components
(ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/dtsref9/html/10b829a1-609b-42e3-9070-cfe5a2bb698c.htm)

A sample is available from here, Ch 14 & 15 - Wrox::Professional SQL Server 2005 Integration Services:Book Information and Code Download
(http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359,descCd-download_code.html)