I am developing a Script Task for my SSIS package to transfer a file via FTP over SSH (SFTP). I have a nice set of Assemblies/DLLs (purchased from IP*Works) that gives me the added functionality of SSH.
To even get Visual Studio for Applications to see it in the reference list, I copied the DLL (nsoftware.IPWorksSSH.Sftp.dll) to the C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 directory, added it in the references for the script, and added the Imports nsoftware.IPWorksSSH.Sftp line in the script.
As described in: http://sqljunkies.com/WebLog/knight_reign/archive/2005/07/07/16018.aspx
Yet, when I try to run the SSIS package I get a DTS Script Task Runtime Error:
Could not load file or assembly 'nsoftware.IPWorksSSH.Sftp, Version=7.1.2203.0, Culture=neutral, PublicKeyToken=cdc168f89cffe9cf' or one of its dependencies. The system cannot find the file specified.
I tried to move the DLL to the bin directory in the SSIS Package, but that did not help.
Hello, Kind of a .Net question, although specifically related to VSA.
We have a script task that references an external DLL. That DLL is a proxy for a web service and it takes its configuration info (e.g. location of the web service) from a configuration file.
We have created a quick-and dirty test harness exe to consume data using the proxy and it works fine. All you need to do is dump the proxy, the config file and the test harness exe into a folder.
This doesn't work so well when you substitute SSIS for the test harness. We are trying to use a script task which references the proxy DLL to get a response from the web service but when we execute we get:
"Cannot find default endpoint element that references contract 'blah blah blah' in the ServiceModel client configuration section. This might be because no configuration file was found for your application..." [See a screenshot here: http://cid-550f681dad532637.skydrive.live.com/self.aspx/Public/Misc/ssis_script_task_config_error.JPG]
This makes sense of course, right? The DLL needs the config file. However, where do you put the config file so that the DLL (which, remember, is running inside SSIS) can find it? We've tried putting it in the same folder as the .dtsx file, in the same folder as dtexec.exe...nothing works.
To try and debug we put the following code into the script task:
Code Snippet Dim rst_Path As String rst_Path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName.CodeBase) MsgBox(rst_Path)
and the resultant message box was contained "file:C:WINDOWSassemblyGAC_MSILMicrosoft_VsaVb8.0.0.0__<GUID>"
which makes complete sense of course.
So, my question is, how can we configure this whole kaboodle of "stuff" so that it works?
I'm creating a script task that needs to reference the Visual Studio Team Foundation Server assemblies, but I'm unable to setup a reference. (Note: the Team Foundation assemblies are part of the VSTS SDK installation.) When designing the script, if I select Project, Add Reference, the .net assemblies for the Microsoft.TeamFoundation namespace are not listed -- even though the assemblies do show up if do the same in a Visual Studio.Net project for C# or VB.
I've also tried to add a reference in a Custom Component Set -- View, Object Browser, Browse, Edit Custom Component Set, and selected a specific assembly. But I get the following error:
--------------------------- Microsoft Visual Studio for Applications --------------------------- The following components could not be browsed:
C:Program FilesVisual Studio 2005 SDK2006.09VisualStudioIntegrationCommonAssembliesMicrosoft.TeamFoundation.dll
Why can that .dll be referenced in standard VB.Net or C#.Net apps, but not in an SSIS script task?
I am using the "Transfer SQL Server Objects Task" to copy some tables from database A to database B including data.
The tables, primary key constraints, Foreign key, data and all transfers nicely except for "DEFAULT CONSTRAINTS" on the tables.
I have failed to find any option in the "Transfer SQL Server Objects Task" task to explicitly say "copy default constraints". So I guess logically it should happen automatically but it doesn't. I hope it is not a bug :-)
In short, does the €œTransfer SQL Server Objects Task€? support distributed transactions?
In trying to use a €œTransfer SQL Server Objects Task€? in a container using a transaction on the container. The task is set to support the transaction. It is setup to copy table data from several tables from a non-domain server (sql server 2000) to a domain-based server (sql server 2005). I get an error stating, €œThis task can not participate in a transaction€?.
I am wondering if it means exactly what it says €“ this task in SSIS can€™t participate at all. Or does it mean that it won€™t in this scenario for some reason. I attempted a simple copy of data from mssql 2005 to mssql 2005 (same server) and the task still failed). MSDTC appears to be running properly on my machine and such (I can do a simple distributed transaction across linked server to the 2000 server in Query Analyzer (QA)). Also, MSDTC appears to be working on both servers with distributed transaction query tests in QA.
Here€™s the error info€¦
SSIS package "Development BusinessContacts and Products Migration.dtsx" starting. Information: 0x4001100A at Copy BusinessContacts Data: Starting distributed transaction for this container. Error: 0xC002F319 at Copy BusinessContacts database table data 1, Transfer SQL Server Objects Task: This task can not participate in a transaction. Task failed: Copy BusinessContacts database table data 1 Information: 0x4001100C at Copy BusinessContacts database table data 1: Aborting the current distributed transaction. Information: 0x4001100C at Copy BusinessContacts Data: Aborting the current distributed transaction. SSIS package "Development BusinessContacts and Products Migration.dtsx" finished: Failure. The program '[4700] Development BusinessContacts and Products Migration.dtsx: DTS' has exited with code 0 (0x0).
I require Api call or any ways to find the installed path of SQL SERVER 2005.
This is required becauses you application register set of extended procedures. As part of SQL SERVER 2005 we found that the dll has to be registered with full path in general <b> "c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinn" </b> since customers may install the server in any drive , i require to find the installed path.
I`m developing a web site with many grids, these grids obtains the data from a SQL Server 2005 DB which data is stored in XML Format... many times when the page load is done, this message appears :
File or assembly name Microsoft.Data.SqlXml, or one of its dependencies, was not found.
But when I access a second time to the same page, the data is displayed normally..
A common issue that I run across with clients is they want only want to process a file if it's finished transmitting to the server. This SQL Server 2005 task reads the properties of a file and writes the values to a series of variables. For example, you can use this task to determine if the file is in use (still be uploaded or written to) and then conditionally run the Data Flow task to load the file if it's not being used. You can also use it to determine when the file was created in order to determine if it must be archived.
Can anyone tell me is it possible to register and access .NET dlls from Stored procedures and how to call those methods in those dlls from Stored procedures
Is there a way to use a custom component programmatically (I'm using C# to create and run my packages) without installing a compiled .dll of the class into the SQL folders and the GAC? For instance, can I instantiate my custom component and somehow pass it to be used in a task in my code.
I've created my own posting for this. The original post was here, I apologize: http://forums.microsoft.com/forums/ShowPost.aspx?PostID=2906512&SiteID=1
According to the poster it's not possible. But there has to be some way to do it? Reflection (don't know how)?
I need to get a reference to the task host in an SSIS Task component.
Basically the scenario is this:
I have a custom task I have created. However I would like to validate that the ExecValueVariable is infact a string variable during the validate event of the task. I know how to verify its a string variable. But I can't figure out how to read what the user selected (such as User::Myvariable). The only way I've been able to figure out how to do it, but it only works if you open my custom task UI.
What I did is this:
I've implemented IDtsTaskUI and during the initialize section I wrote:
Sub Initialize(ByVal taskHost As TaskHost, ByVal serviceProvider As IServiceProvider) Implements IDtsTaskUI.Initialize ' Store the TaskHost of the task. Me.taskHostValue = taskHost Dim myTask As CustomTask= CType(taskHost.InnerObject, CustomTask) myTask.myTaskHost = taskHost End Sub
My Task is named: CustomTask. I have a public variable in my task as follows:
Public NotInheritable Class CustomTask Inherits Task Implements IDTSComponentPersist Public myTaskHost As TaskHost = Nothing
Therefore I pass back the taskhost value to the CustomTask class, and voila I have it.
Problem is, this only works if the custom task calls the initialize method, and this only happens when you open the custom editor.
I then do the validation in my CustomTask class and it works fine, but myTaskHost is null/nothing until you actually open the custom task UI
I'm just wondering what the effect of including a form in a dll would have on a system? I created a dll that actually has a hidden form in it and is called from a stored procedure using SQL Server 2000. I needed some of the functionality of the richTextBox control, only I didn't want to actually display the form with the box on it. This seems to work when called from a stored procedure (the method called returns correct values and the form never shows up on the server), but are there any inherent problems with this I'm not aware of? I wouldn't think it would be a memory leak and we're not too worried about security. I'm using this as a shortcut around having to write something that converts rich text into plain text and allows us to search the document for keywords. I know this might be a ghetto way around it, but it seems to work.
I am developing a native C++ application using SQLCE (.NET is not a current option). Am having a problem while using multiple accessors for multiple blobs in a table. After I read the data for the first blob & try to read the data for the second one, I get an error in one of the dlls (something about using heap data that was freed). Where can I get symbol data so that I can use something like Windbg to resolve my problem.
I've been having an issue with the integration of a third-party DLL into a custom data flow component.
The company sent me a C# project that generates a simple console application. The project includes a class that calls their DLL with DllImport. The console application runs fine.
I created a stand-alone class using the C# class they sent to expose the methods of their DLL. In my custom component, I'm referencing this class to pass data to and from their DLL.
The first method from that stand-alone class that my component encounters simply gets their installation path from the registry and does not use DllImport. That path retrieval works fine. The next method calls a function that is declared with DllImport. Each time the call fails with "System.DllNotFoundException = {"Unable to load DLL AMZip.dll': Exception from HRESULT: 0xE06D7363"}".
I've copied this DLL to countless locations (e.g., the PipelineComponents directory, the project/solution bin directory) and included these paths in all manner of path variables.
What am I missing here? Their DLL is not strong named (does this matter since I'm using DllImport?), my stand-alone class is, and of course, the custom component itself is. I appreciate the help.
I wrote an assembly and attached to a trigger in one of my tables. It works as I expected, but then I decided to modify the code, say adding some new triggers that I will use with other tables. Then I realize that in order to update my new version of the assembly in SQL first I need to remove the trigger in the table, then remove the assembly, add the new version and finally run a script to create the trigger again in the table.
How could I avoid going through all this process everytime I want to update my assembly?
I am running a CLR stored proc that goes to an EDS (Novell) server with LDAP and returns records into a SQL table.
I am using the Novell ldap library.
I want to do this with SSL so my code referneces the Mono security library as well.
However when I make the call to the stored proc to run in SSL, I get an object not found error. I do not think that the the Novell assembly can "find" the Mono assembly.
Two points: 1/ I can do the SSL if I run it as an asp.net page (so I know the SSL works) 2/ The proc runs and pulls all the records in non-SSL (so I know the proc works)
i found one tutorial on self signing assemblies for use in sql server, but it appears to have errors. does anyone know of a better tutorial on this topic? the site im currently looking at is here: http://www.sqljunkies.com/WebLog/ktegels/articles/SigningSQLCLRAssemblies.aspx
I have a question: how is it planned to replicate changes made to the assemblies and to the CLR functions or UDT? Will Visual Studio deploy change of the Assembly as ALTER not DROP/CREATE?
How does SQL Server 2005 handle the replication of assemblies? I get the following when trying to replicate an assembly:
Timestamp: 6/15/2007 9:41:33 AM Message: HandlingInstanceID: 05eaed53-b6be-42da-8c72-0f91fcbfa5b6 An exception of type 'Microsoft.SqlServer.Replication.ComErrorException' occurred and was caught. ------------------------------------------------------------------------------------------------- 06/15/2007 09:41:33 Type : Microsoft.SqlServer.Replication.ComErrorException, Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 Message : The schema script 'StratisDSonetd85d6e89_1061.sch' could not be propagated to the subscriber. Source : Merge Replication Provider Help link : ErrorMessage : Unspecified error InterfaceId : 00000000-0000-0000-0000-000000000000 HelpFile : HelpContext : 0 Description : The schema script 'StratisDSonetd85d6e89_1061.sch' could not be propagated to the subscriber. ComHResult : -2147467259 ErrorCode : -2147467259 Data : System.Collections.ListDictionaryInternal TargetSite : Void Run() Stack Trace : at Microsoft.SqlServer.Replication.MergeSynchronizationAgent.Run() at Microsoft.SqlServer.Replication.MergeSynchronizationAgent.Synchronize() at SQLClientSync.SQLClientSync.Replicate() Additional Info: MachineName : REPCLIENT TimeStamp : 6/15/2007 1:41:33 PM FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=1.1.1.1, Culture=neutral, PublicKeyToken=d2ff10320a77ec18 AppDomainName : sqlclientsync.exe ThreadIdentity : WindowsIdentity : REPCLIENTAdministrator
I appears that the initial replication of the assembly was fine, when re-running the sync (no changes to the assembly), this error is generated.
I need to dynamically create a ADO.NET connection manger
so, my question is if it is safe to create it with the string that is generated (ConnectionManagerType) when creating the connection manager manually on my PC.
I understood that this string is the full qualified name of the assembly, so will it be different when I create it on another P.C or it is fixed on all P.Cs ?
I have followed the steps outlined in the knowledge base article http://support.microsoft.com/kb/913668 for effecting Xml Serialization within the SQL CLR. That is, I have
1. Prebuilt the serialization assembly X.Serializers for the types in assembly X and,
2. Registered both assemblies with SQL Server via the create assembly directive
Yet, when I attempt to create an XmlSerializer on the basis of one of the types defined in X, SQL CLR ignores the pre-built serialization assembly and attempts to dynamically create/load the assembly. Since dynamic loading is disallowed, this fails with the expected exception:
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. ---> System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
Where is it documented what the list of approved assemblies are for SQL 2005. Also, is there a way via T-SQL, or other means to get it programatically?
I'm building a SQL function from C++ and compile my assembly with /clrafe. After that I create the assembly with SAFE permission sets and create the function, both in SQL. But the server don't accept load or execute the function because of permission error. It says:
Code Snippet
"An error occurred in the Microsoft .NET Framework while trying to load assembly id 65561. The server may be running out of resources, or the assembly may not be trusted with PERMISSIONSET = EXTERNALACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues."
Does the terminology coince with the technology, or is it diffrent "safety" conditions we are speaking about? One for the SQL permission set, and another safety for CLR type-safe assemblies?
Anyway, after playing around a bit, and following the tricks from this thread. I managed to load and execute the function, but only in UNSAFE permission (unrestricted mode?)
---8<----
My second question is can I use unrestricted mode for assembly compiled with /clr (mixed CLR)?
I'm asking, because I have some C source code that I want to reuse, and for this I can't be type-safe and therefore need to compile only with /clr (mixed CLR).
Should I go back to the plain C API in SQL 2000 to implement such function in SQL 2005, and ignore all new things in c++/CLR/.NET?
If you have any points to C++ sample code, then please forward this to me.
I have followed the steps outlined in the knowledge base article http://support.microsoft.com/kb/913668 for effecting Xml Serialization within the SQL CLR. That is, I have
1. Prebuilt the serialization assembly X.Serializers for the types in assembly X via the SGEN tool and,
2. Registered both assemblies with SQL Server via the create assembly directive
Yet, when I attempt to create an XmlSerializer on the basis of one of the types defined in X, SQL CLR ignores the pre-built serialization assembly and attempts to dynamically create/load the assembly. Since dynamic loading is disallowed, this fails with the expected exception:
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. ---> System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
Did this as a exercise and am fed up with my fruitless searching.Went and create an CLR assembly and all with min hassel. Now that Ihave that dll out there, I am tring to find some system table or somedisplay in management studio that shows me where the file is located onthe hard drive and cannot locate it.Can someone please point me in the correct location.Thanks.