April 8, 2013 at 1:50 pm
I need to set the unicode property of a connection manager (which is a variable) to true in a Script Task. Can you please help?
April 8, 2013 at 6:43 pm
Any idea? How to set property of connection manager flat file in script task?
April 8, 2013 at 6:48 pm
SQL_Surfer (4/8/2013)
I need to set the unicode property of a connection manager (which is a variable) to true in a Script Task. Can you please help?
What do you mean by "which is a variable"?
Do you mean you have a reference to the flat file connection manager using a ConnectionManagerFlatFileClass object?
If yes, then obj.unicode = true;
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
April 8, 2013 at 7:10 pm
Thanks. How to create an object for a flat file connection manager class?
April 9, 2013 at 7:45 am
Sorry. I meant I can't use ConnectionManagerFlatFile in script task directly. Can I use ConnectionManagerFlatFile in script task? or Do i have to use ConnectionManager class? Can you pleae show me an example of this? Sorry, I am brand new to script task.
April 9, 2013 at 1:27 pm
Can you post some code to show what you are trying to do? it might help.
All I can show for now is this:
get your connectionmanager from the dts.connections collection and set the property...
Dim myCM As ConnectionManager = Dts.Connections("MyFlatFileConnection")
myCM.Properties("Unicode").SetValue(myCM, True)
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
April 9, 2013 at 2:05 pm
Thanks!
I am using C# like this.
ConnectionManager myCM = Dts.Connections["FlatFileConnection"];
myCM.Properties["UniCode"].SetValue(myCM, true);
Getting the follwoing error now:
Error: The connection type "FlatFileConnection"
specified for connection manager "{A287DAAF-E9D7-44FB-AD6F-64C39F30CBD0}"
is not recognized as a valid connection manager type.
This error is returned when an attempt is made to create a connection manager for an unknown connection type.
Check the spelling in the connection type name.
April 9, 2013 at 2:32 pm
You might need to iterate through the connections collection to find yours then, assuming you have spelled it right?
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
April 9, 2013 at 4:29 pm
I just tried it in C# script
ConnectionManager myCM = Dts.Connections["MyFlatFileConnection"];
myCM.Properties["Unicode"].SetValue(myCM,true);
and it worked perfectly.
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
April 10, 2013 at 7:37 am
Yes. It worked. I think I was typing as UniCode, which seems to be case sensitive.
April 10, 2013 at 8:01 am
SQL_Surfer (4/10/2013)
Yes. It worked. I think I was typing as UniCode, which seems to be case sensitive.
The wonders of C#...
Whatever language you use though, that is one horrendous method call!
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply