Problem Creating Folder Through Package

Jun 30, 2006

hi !

I am creating a directory folder inside the package. At first attempt while running the package it creates without any errors but when i run it second time it throws up warning message : Directory already exists. but the package succeeds.

When i try running it from another server through command line it fails. saying that Device it not Ready.

What is the proble here !!!!!!! Any help please

Jas

View 2 Replies


ADVERTISEMENT

Creating A Report To PDF In A Folder?

Aug 22, 2007

We have created a report called "update" that we want to run every hour and place in a directory called d:infoupdate.pdf

We would like to call the report from a procedure and have the proc generate the report in PDF format in the directory d:info

Does anyone know how to do this?

View 2 Replies View Related

Creating MSDB Folder Via Script Or MSI

Sep 26, 2007

I've created an MSI project that configures and installs an SSIS package to a sub-folder under MSDB using the DTS runtime SaveToSqlServerAs() method. Right now, I have to create the sub-folder via SSMS beforehand. Is there a way to create the sub-folder via the DTS runtime or a SQL command during the MSI install?

View 1 Replies View Related

Problem With Creating Directory By SQL Server On A Remote Shared Folder

Jul 18, 2006

Dear all,

I now have 2 server, say serverA and serverB. ServerA has a SQL server and I am using a command in the SQL server to access the serverB. The command is:

declare @command varchar(500)
set @command = 'mkdir ' + '"\serverBabckevin_wong123"
exit'
exec master.dbo.XYRunProc
'cmd.exe',
'c:',
@command

where abc is a shared folder in serverB which can be accessed by serverA. However the output of this execution is "c:> mkdir "\serverBabckevin_wong123" Access is denied". It is possible to do this in command prompt. Does anyone know what's the problem of this?

Thank you very much!!

Kevin

View 1 Replies View Related

Integration Services :: Way Of Creating Shared Folder In Order To Perform Operation From Title

Apr 14, 2015

having on mind that this is my Target server: what is the way of creating shared folder in order to perform operation from the title (and, of course, to continue with installation of packages etc...)? SQL SERVER 2008 R2

View 26 Replies View Related

Saving A Package Into A Folder In MSDB

Mar 9, 2007

Hi

I am trying to load a ssis package into a folder (lets say SSIS packages) that I created in MSDB but its geeting saved in the root (MSDB) not into the SSIS packages folder...I am doing this thru C#...

View 3 Replies View Related

How To Determine Package's Executing Folder?

Oct 12, 2006

I should have written this down when I came across it -- but I recently saw an example of how to determine a package's currently-executing folder. Can anyone help?

Thanks!

- Mike

View 5 Replies View Related

Several Different Errors When Creating And Running SSIS Package. Package Runs Successfuly Sometimes.

May 2, 2008

Hi All,



I am in the process of moving from a 32-bit SQL Server 2005 Enterprise (9.0.3054) to a 64-bit SQL Server 2005 Enterprise (9.0.3054 with 4 CPUs and 8GB of memory on Win 2003 SP2) and the process has been very frustrating to say the least. I am having a problem with packages that I created on my 64-bit SQL Server. I am importing a few tables from the 32-SQL Server into the 64-bit SQL Server using the Task --> Import to create the package.



Sometimes when I am creating a package I get the following error in a message box:



SQL Server Import and Export Wizard

The SSIS Runtime object could not be created. Verify that DTS.dll is available and registered. The wizard cannot continue and it will terminate.

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (System.Windows.Forms)





Other times when I run a package that has run successfully before I get the following error:



Faulting application dtexecui.exe, version 9.0.3042.0, stamp 45cd726d, faulting module unknown, version 0.0.0.0, stamp 00000000, debug? 0, fault address 0x025d23f0.





Other times I get this error message:



.NET Runtime version 2.0.50727.1433 - Fatal Execution Engine Error (79FFEE24) (80131506)





And still other times



The package appears to hang when running. By this I mean that the Package Execution Progress shows progress up to a point then it just stops. (The package takes about 17 seconds to run normally) CPU usage is at 1% and the package cannot be stopped.





I have deleted and re-created the package several times and I have also re-installed the service pack on the SQL Server (9.0.3054) but that did not help.





Does anyone have any other suggestions to try?





Thanks.



View 4 Replies View Related

Does Not Work --ETL Package Tutorial (Lesson 1: Creating The Project And Basic Package )

Nov 4, 2006

Hi,

I am new to SSIS. I followed the direction of the tutorial Creating Simple ETL Tutorial package in BooksOnline. I have tried more than five times and have done exactly as suggested in the tutorial but it does not work.

The URL is:

http://msdn2.microsoft.com/en-us/library/ms169917.aspx

I get these warnings and finally fails:

1)[Lookup [30]] Error: Row yielded no match during lookup.

2) [Lookup [30]] Error: The "component "Lookup" (30)" failed because error code 0xC020901E occurred, and the error row disposition on "output "Lookup Output" (32)" specifies failure on error. An error occurred on the specified object of the specified component.

3) [DTS.Pipeline] Error: The ProcessInput method on component "Lookup" (30) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

4) [DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0209029.

Can someone help me with this tutorial error? or Am I doing something wrong.

Thank you,







View 6 Replies View Related

Where Is The Folder For SSIS Package Whiile Creatig Sqlserver Job

Mar 13, 2008

when i tried to create an sql server package with ssis Package , i am not able to find the path for putting the ssis package , Whele i browse for package , i am getting olt one SSIS Package forlder and i am not able to locate that forlder in my drive ? what should i do ? How can i copy my package to this folder ?

is there any option to Change the default folder ?

View 4 Replies View Related

SQL Server 2008 :: SSIS - Package To Zip Contents Of A Folder Into One ZIP File

Aug 12, 2015

I have a requirement to create a package that takes all files in a given folder and adds them to a single archive (.zip) file. I've tried several methods using 7zip and while I can create archives for every file in the directory I can't seem to get them into a single .zip file.

View 9 Replies View Related

Integration Services :: How To Run All SSIS Packages In A Folder Using Execute Package Task

Jun 26, 2015

I have created for each container to call all the packages in a folder like below, also created a variable.

Then I add execute package task inside of foreach container and selected file system in a location and in connection called currently creating package name finally in connection properties i added variable in expression which i created and mapped into for each loop container. I referred below link 

[URL] ....

All the packages are running but its not ending once all the packages executed its re run and continue the running process, how to stop once all the packages execute. 

View 24 Replies View Related

Error Creating Package - Failed To Save Package File ... Emp EmpD4B.tmp With Error 0x80040154 Class Not Registered

May 19, 2006

I had just installed SQL 2005 dev on my laptop and got an error message when I tried to create a package using the BI IDE. I received the same error using VS2005 IDE. But the project was created regardless without any packages. When I tried to create a new package in the project, I received the same error again, but with an option to view the error details.

Following is the text of the error details:

TITLE: Microsoft Visual Studio
------------------------------

Error creating package

------------------------------
ADDITIONAL INFORMATION:

Failed to save package file "C:Documents and SettingsmyoungbloodLocal SettingsTemp mpD4B.tmp" with error 0x80040154 "Class not registered".


------------------------------

Failed to save package file "C:Documents and SettingsmyoungbloodLocal SettingsTemp mpD4B.tmp" with error 0x80040154 "Class not registered".


------------------------------
BUTTONS:

OK
------------------------------
I found a similar post that suggested that they try the following:


regsvr32 msxml3.dll
regsvr32 msxml4.dll
regsvr32 msxml6.dll

But msxml6.dll could not be found.

I did get a copy of this file from a coworker, and after copying it and registering it, I was able to add a package to the project.

My concern now is what is the likelyhood of this being the only file missing from the installation.

I'm wondering if I should reinstall, or (if it exists) do a repair on the installation.

Thanks.

Marshall

View 12 Replies View Related

Unable To Copy App_data Folder Databases On Production Server To A Different Folder Or Location

Sep 19, 2007

I dont alot about sql server 2005(Express edition). For debugging purposes i want to copy  the whole app_data folder(.mdf & .log files) on the production server to another folder on the same machine(or sometimes to a network folder).  So when i copy and try to paste this App_data folder to a new location, i get this error message
"cannot copy ASPNETDB: it is being used by another person or program. close any programs that might be using the file and try again."
After reading the above message, i close visual web developer, stop the website in IIS and stop the SQLExpress service on the server and try again but still get the same message.
So how can i make sure that all the programs accessing these database files are closed such that i'm able able to copy them to a different location.

View 2 Replies View Related

Integration Services :: SSIS WMI Event Watcher Check For New Folder In Existing Folder

Jul 2, 2015

I know a WMI event watcher can be used to watch for a new file being added to a folder. However, I need to check for new folders being added to an existing folder. I haven't been able to find a post on doing this. Is there a way in WQL to check for a new folder being added instead of a new file? I've used SQL for years, but am new to SSIS.

View 2 Replies View Related

SSIS Or SQl Agent Job Moving From A Network Folder To A Sharepoint Folder - Errors...

Oct 31, 2007



Ok,

I have a network folder called A

I have a SharePoint (2007) Document Library site called B. Web Client is enabled on the server and B is mapped as a Drive (let's call it Y for this discussion)

I want to move documents in A to B. Easy enough, right? Not so....

I first started by creating a batch file that issues a COPY \A \Y /Y at the command prompt. Viola! Worked Great!

I then moved that command to a SQL Agent job as a CMDExec statement (exact same statement) and attempted to run it.....CRASH! It found the files in A but then said "The system cannot find the path specified"

Ok, so I tried it in SSIS. CRASH! Checked the error log. Same thing...

So I then checked the account under which the SQl Agent was running (special domain account for all our SQL Servers). Thinking it might mater I changed it to run under my name (I'm in Domain admin). I also ensured I had permissions to the SPS 2007 library as well. (I did).

Ran again! CRASH! Same error....

So, I created a batch file , placed thec ommand in the batch file and ran that from the command prompt! Viola! Worked Great.

So, I was thinking of how ingenious I was as I pasted my C:RootCopy.bat into my SQL Agent job. With a big grin on my face I right clicked and picked "Start Job at step".......CRASH! Same error.

Does anyone have any ideas on this ???????????????

Thanks,
Stephen

View 3 Replies View Related

Can I Use The Foreach Loop To Obtain The Sub Folder Names Within A Folder?

Sep 4, 2006

I have a set of folders with the following structure:

MainFolder

1999

SpreadsheetA.xls

SpreadsheetB.xls

SpreadsheetC.xls

2000

SpreadsheetA.xls

SpreadsheetB.xls

SpreadsheetC.xls

etc.

Is there a way that I can use the foreach loop container to loop the sub folders? My plan was to get the folder name and path into a variable, use this to build the connection string for each file in this folder, carry out the upload for that folder, then move onto the next folder and do the same thing, but I cannot see a way to do this.

Thanks,

Sam

View 2 Replies View Related

Creating DTS Package In SQL 7 Using VB

Feb 7, 2002

Hi all,
I want to import a text file into SQL DB by programmatically creating the DTS Package in SQL 7.0 Using Visual Basic 6.0.

I need some good example regarding above subject.

Please Help!

Ajay

View 1 Replies View Related

Creating A DTS Package?

Oct 25, 2007

I have a small question relating to the creation of DTS Packages. I have to create a DTS Package with the following conditions -

- The accounting department gets a text file every month, they also want the same text file in Excel format. Which they will send it to a third party.
- I want to be able to create a scheduled report based upon this information.
- Also setting a schedule on the day when this will take place.

I know how to create a DTS Package, however I am a little new. So any help will be greatly appreciated. Let me know if you need more info.

Nishi

View 3 Replies View Related

Creating A DTS Package

Jul 20, 2005

I've created a DTS package and now I need to distribute it todifferent servers.I've been looking for a way to automatically/programatically create aDTS package, but have not found anything definite.From the DTS package itself, I see where I can save the dts package asa structured file, with the name XXXXX.dts. Once I have that DTSfile, how dow I turn it back into a dts package in Enterprise manager?I don't want to have to manually create the package for 300+servers...Thanks,Jennifer

View 1 Replies View Related

Creating A Package

Oct 9, 2007

Hi friends,

I'd like to know if there's any way I can make a package that runs a script in SQL 2005 Standard Edition?
I'm also wondering if there's a way to write a script to access database to a different server.. specifically SQL 2005 Standard.

I appreciate all of your answers.

thanks

Mike

View 1 Replies View Related

Error In The DLL Msg When Creating DTS Package

Mar 20, 2001

Hi
I have a Win2K SP1 server running SQL 7. Whenever I try to create a DTS package, I get a box headed "DTS CoCreateInstance" with "Error in the DLL" as the box text. I have tried removing and re-installing SQL 7 and have also applied SQL SP 1,2 & 3. There are no errors in the event log, just the popup error outlined above.

Has anyone seen this error, and is there a fix?


Thanks

Simon Thomas

CommArc Consulting Ltd

View 1 Replies View Related

Creating A SQL 7.0 Database In A Package

Sep 5, 2000

Hi,

Is there a SQL call or some other way "scripted" way to create a database in SQL 7.0? We have an application that runs on a client's local database and we want them to be able to run a package that creates the database (as opposed to an administrator logging onto their database and doing it manually through the wizard). There are commands to detach and attach databases(i.e. move them) but not to create them.

Thanks in advance...
Ryan

View 1 Replies View Related

Creating A DTS Package With SQL Server

Jan 15, 2006

I'm totally new to SQL Server, so any help would be appreciated. I want to create a DTS Package, but I'm not really sure where to start. I've read a few tutorials online, but the "New project" menu of the Evaluation Version of SQL Server 2005 does not look the same as the tutorials, and does not include "DTS"

Should I try SQL Server 2000 instead, or am I just missing something in 2005?

View 1 Replies View Related

Creating A DTS Package Programaticaly

Jul 20, 2005

Hi,I want to create a DTS package programatically (preferably inC#.net),which will copy all my tables from a oracle database to mysql-server database.Can anybody help me doing this???ThanksPatnayak

View 2 Replies View Related

Creating A SSIS Package

Mar 5, 2007

HI All,



can any body give steps to import data from one sqldb to another through ssis package, i was comfotable with dts but ssis is a lil bit confusing.....



thnx

regards

View 1 Replies View Related

Creating An SSIS Package

Feb 18, 2008

Can anyone give a newbie a general script for creating an SSIS page to import data nightly from an Access database to sql 2005. They are not on the same server. The Access database us 366,968 kb and grows everyday from input from web content. It has 5 tables and 100's of queries, which is how it is updated.

Please give me a starting point, do not understand the info in books on line.

Thank you
Dee

View 6 Replies View Related

Creating Excel File From DTS Package

Oct 20, 2004

Hi,

I have a created a DTS packges which is reading data from sql server table, manipulate this data as required and then create a text file with that data. I created the text file using FileSystemObject. I was writing one field at a time to the text file.

I need to same thing but instead of creating text file, I need to create a excel file with each column from database going to separate column in excel sheet. I tried to do this with FileSystemObject, but it was wrting all the columns from database to one cell in excel sheet. How can I fix this problem?

Thanks!

View 8 Replies View Related

Need Help Creating A SSIS Package (Newbie)

Mar 12, 2006

Following is what I would like to do, so I can keep updating my central SQL Server database with latest updates from the field. I like to use SSIS 2005 to create a package that could do this. Any help to get me started would be appreciated. I need some help soon, pls give me something to get started. APpreciate it. Thanks.

Open connection and read client location table on the local SQL Server database called PODO
For each location id in the table do the following:
Store locationid/clientid in a variable called CLLOC_ID
Construct file name with mdb extension and store in a variable MDB_FILE
Establish connection to the data import folder
Search for that MDB_FILE in the folder on the file system
If there is a file where match = true then do this:
1) Open the access database
2) Read and import the data from the customer experience table
3) Write that data to the SQL Server tables where location = CLLOC_ID
4) Exit process
IF there is no match, exit process
Keep looping until all the client ids/loc ids are read from the SQL Server client location table.



MA

View 4 Replies View Related

Programmatically Creating SSIS Package

Jan 4, 2007

Hi guys,
 
I was intended to write a program that will create a SSIS package which will import data from a CSV file to the SQL server 2005. But I did not find any good example for this into the internet. I found some example which exports data from SQL server 2005 to CSV files. And following those examples I have tried to write my own. But I am facing some problem with that. What I am doing here is creating two connection manager objects, one for Flat file and another for OLEDB. And create a data flow task that has two data flow component, one for reading source and another for writing to destination. While debugging I can see that after invoking the ReinitializedMetaData() for the flat file source data flow component, there is not output column found. Why it is not fetching the output columns from the CSV file? And after that when it invokes the ReinitializedMetaData() for the destination data flow component it simply throws exception.
Can any body help me to get around this problem? Even can anyone give me any link where I can find some useful article to accomplish this goal?
I am giving my code here too.
I will appreciate any kind of suggestion on this.
 
Code snippet:
 
public void CreatePackage()
{
string executeSqlTask = typeof(ExecuteSQLTask).AssemblyQualifiedName;
      Package pkg = new Package();
      pkg.PackageType = DTSPackageType.DTSDesigner90;
ConnectionManager oledbConnectionManager =              CreateOLEDBConnection(pkg);
ConnectionManager flatfileConnectionManager =
             CreateFileConnection(pkg);
      // creating the SQL Task for table creation
Executable sqlTaskExecutable = pkg.Executables.Add(executeSqlTask);
ExecuteSQLTask execSqlTask = (sqlTaskExecutable as Microsoft.SqlServer.Dts.Runtime.TaskHost).InnerObject as ExecuteSQLTask;
      execSqlTask.Connection = oledbConnectionManager.Name;           
      execSqlTask.SqlStatementSource =
"CREATE TABLE [MYDATABASE].[dbo].[MYTABLE] ([NAME] NVARCHAR(50),[AGE] NVARCHAR(50),[GENDER] NVARCHAR(50)) GO";
      // creating the Data flow task
Executable dataFlowExecutable = pkg.Executables.Add("DTS.Pipeline.1");
      TaskHost pipeLineTaskHost = (TaskHost)dataFlowExecutable;
      MainPipe dataFlowTask = (MainPipe)pipeLineTaskHost.InnerObject;           
      // Put a precedence constraint between the tasks.           
PrecedenceConstraint pcTasks = pkg.PrecedenceConstraints.Add(sqlTaskExecutable, dataFlowExecutable);
      pcTasks.Value = DTSExecResult.Success;
      pcTasks.EvalOp = DTSPrecedenceEvalOp.Constraint;
      // Now adding the data flow components
IDTSComponentMetaData90 sourceDataFlowComponent = dataFlowTask.ComponentMetaDataCollection.New();
      sourceDataFlowComponent.Name = "Source Data from Flat file";
      // Here is the component class id for flat file source data
      sourceDataFlowComponent.ComponentClassID = "{90C7770B-DE7C-435E-880E-E718C92C0573}";
CManagedComponentWrapper managedInstance = sourceDataFlowComponent.Instantiate();
      managedInstance.ProvideComponentProperties();           
            sourceDataFlowComponent.
RuntimeConnectionCollection[0].ConnectionManagerID = flatfileConnectionManager.ID;
            sourceDataFlowComponent.
RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(flatfileConnectionManager);
     
managedInstance.AcquireConnections(null);
      managedInstance.ReinitializeMetaData();
      managedInstance.ReleaseConnections();
      // Get the destination's default input and virtual input.
IDTSOutput90 output = sourceDataFlowComponent.OutputCollection[0];
                        // Here I dont find any columns at all..why??
      // Now adding the data flow components
IDTSComponentMetaData90 destinationDataFlowComponent = dataFlowTask.ComponentMetaDataCollection.New();
      destinationDataFlowComponent.Name =
"Destination Oledb compoenent";
      // Here is the component class id for Oledvb data
      destinationDataFlowComponent.ComponentClassID = "{E2568105-9550-4F71-A638-B7FE42E66922}";
CManagedComponentWrapper managedOleInstance = destinationDataFlowComponent.Instantiate();
      managedOleInstance.ProvideComponentProperties();
destinationDataFlowComponent.
RuntimeConnectionCollection[0].ConnectionManagerID = oledbConnectionManager.ID;
destinationDataFlowComponent.
RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oledbConnectionManager);
      // Set the custom properties.
      managedOleInstance.SetComponentProperty("AccessMode", 2);                 
managedOleInstance.SetComponentProperty("OpenRowset", "[MYDATABASE].[dbo].[MYTABLE]");           
      managedOleInstance.AcquireConnections(null);
      managedOleInstance.ReinitializeMetaData();  // Throws exception
      managedOleInstance.ReleaseConnections();           
      // Create the path.
IDTSPath90 path = dataFlowTask.PathCollection.New();            path.AttachPathAndPropagateNotifications(sourceDataFlowComponent.OutputCollection[0],
      destinationDataFlowComponent.InputCollection[0]);
      // Get the destination's default input and virtual input.
IDTSInput90 input = destinationDataFlowComponent.InputCollection[0];
      IDTSVirtualInput90 vInput = input.GetVirtualInput();
      // Iterate through the virtual input column collection.
foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)
      {
          managedOleInstance.SetUsageType(
input.ID, vInput, vColumn.LineageID, DTSUsageType.UT_READONLY);
      }
      DTSExecResult res = pkg.Execute();
}
public ConnectionManager CreateOLEDBConnection(Package p)
{
      ConnectionManager ConMgr;
      ConMgr = p.Connections.Add("OLEDB");
      ConMgr.ConnectionString =
"Data Source=VSTS;Initial Catalog=MYDATABASE;Provider=SQLNCLI;Integrated Security=SSPI;Auto Translate=false;";
      ConMgr.Name = "SSIS Connection Manager for Oledb";
      ConMgr.Description = "OLE DB connection to the Test database.";
      return ConMgr;
}
public ConnectionManager CreateFileConnection(Package p)
{
      ConnectionManager connMgr;
      connMgr = p.Connections.Add("FLATFILE");
      connMgr.ConnectionString = @"D:MyCSVFile.csv";
      connMgr.Name = "SSIS Connection Manager for Files";
      connMgr.Description = "Flat File connection";
      connMgr.Properties["Format"].SetValue(connMgr, "Delimited");
connMgr.Properties["HeaderRowDelimiter"].SetValue(connMgr, Environment.NewLine);
      return connMgr;
}
 
And my CSV files is as follows
 
NAME, AGE, GENDER
Jon,52,MALE
Linda, 26, FEMALE
 
Thats all. Thanks.

View 4 Replies View Related

Creating SSIS Package Failed

Aug 6, 2007

Hi,

I'm trying to create a SSIS package. I have used OLEDBSource adapter to get the source table's data and transferring the data to an OLEDBDestination adapter. I tried but I'm facing the problem in mapping the metadata contents.

My code:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void Main(string[] args)

{

// Create a new package

Package package = new Package();

package.Name = "OLE DB Transfer";

// Add a Data Flow task

TaskHost taskHost = package.Executables.Add("DTS.Pipeline") as TaskHost;

taskHost.Name = "Transfer Table";

IDTSPipeline90 pipeline = taskHost.InnerObject as MainPipe;

// Get the pipeline's component metadata collection

IDTSComponentMetaDataCollection90 componentMetadataCollection = pipeline.ComponentMetaDataCollection;

// Add a new component metadata object to the data flow

IDTSComponentMetaData90 oledbSourceMetadata = componentMetadataCollection.New();

// Associate the component metadata object with the OLE DB Source Adapter

oledbSourceMetadata.ComponentClassID = "DTSAdapter.OLEDBSource";

// Instantiate the OLE DB Source adapter

IDTSDesigntimeComponent90 oledbSourceComponent = oledbSourceMetadata.Instantiate();

// Ask the component to set up its component metadata object

oledbSourceComponent.ProvideComponentProperties();

// Add an OLE DB connection manager

ConnectionManager connectionManagerSource = package.Connections.Add("OLEDB");

connectionManagerSource.Name = "OLEDBSource";

// Set the connection string

connectionManagerSource.ConnectionString = "provider=sqlncli;server=HSCHBSCGN25008;integrated security=sspi;database=Muthu_SSIS_Testing";

// Set the connection manager as the OLE DB Source adapter's runtime connection

IDTSRuntimeConnection90 runtimeConnectionSource = oledbSourceMetadata.RuntimeConnectionCollection["OleDbConnection"];

runtimeConnectionSource.ConnectionManagerID = connectionManagerSource.ID;

// Tell the OLE DB Source adapter to use the SQL Command access mode.

oledbSourceComponent.SetComponentProperty("AccessMode", 2);

// Set up the SQL command

oledbSourceComponent.SetComponentProperty("SqlCommand", "select * from EmployeeTable");

// Set up the connection manager object

runtimeConnectionSource.ConnectionManager = DtsConvert.ToConnectionManager90(connectionManagerSource);

// Establish the database connection

oledbSourceComponent.AcquireConnections(null);

// Set up the column metadata

oledbSourceComponent.ReinitializeMetaData();

// Release the database connection

oledbSourceComponent.ReleaseConnections();

// Release the connection manager

runtimeConnectionSource.ReleaseConnectionManager();

// Add a new component metadata object to the data flow

IDTSComponentMetaData90 oledbDestinationMetadata = componentMetadataCollection.New();

//Associate the component metadata object with the OLE DB Destination Adapter

oledbDestinationMetadata.ComponentClassID = "DTSAdapter.OLEDBDestination";

// Instantiate the OLE DB Destination adapter

IDTSDesigntimeComponent90 oledbDestinationComponent = oledbDestinationMetadata.Instantiate();

// Ask the component to set up its component metadata object

oledbDestinationComponent.ProvideComponentProperties();

// Add an OLE DB connection manager

ConnectionManager connectionManagerDestination = package.Connections.Add("OLEDB");

connectionManagerDestination.Name = "OLEDBDestination";

// Set the connection string

connectionManagerDestination.ConnectionString = "provider=sqlncli;server=HSCHBSCGN25008;integrated security=sspi;database=Muthu_SSIS_Testing";

// Set the connection manager as the OLE DB Destination adapter's runtime connection

IDTSRuntimeConnection90 runtimeConnectionDestination = oledbDestinationMetadata.RuntimeConnectionCollection["OleDbConnection"];

runtimeConnectionDestination.ConnectionManagerID = connectionManagerDestination.ID;

// Tell the OLE DB Destination adapter to use the SQL Command access mode.

oledbDestinationComponent.SetComponentProperty("AccessMode", 2);

// Set up the SQL command

oledbDestinationComponent.SetComponentProperty("SqlCommand", "select from EmplTable");

// Set up the connection manager object

runtimeConnectionDestination.ConnectionManager = DtsConvert.ToConnectionManager90(connectionManagerDestination);

// Get the standard output of the OLE DB Source adapter

IDTSOutput90 oledbSourceOutput = oledbSourceMetadata.OutputCollection["OLE DB Source Output"];

// Get the input of the OLE DB Destination adapter

IDTSInput90 oledbDestinationInput = oledbDestinationMetadata.InputCollection["OLE DB Destination Input"];

// Create a new path object

IDTSPath90 path = pipeline.PathCollection.New();

// Connect the source and destination adapters

path.AttachPathAndPropagateNotifications(oledbSourceOutput, oledbDestinationInput);

IDTSInput90 input = oledbDestinationInput;

IDTSVirtualInput90 vInput = input.GetVirtualInput();

foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)

{

// Call the SetUsageType method of the destination

// to add each available virtual input column as an input column.

oledbDestinationComponent.SetUsageType(

input.ID, vInput, vColumn.LineageID, DTSUsageType.UT_READONLY);

}

foreach (IDTSInputColumn90 col in oledbDestinationInput.InputColumnCollection)

{

IDTSExternalMetadataColumn90 exCol = oledbDestinationInput.ExternalMetadataColumnCollection[col.Name];

oledbDestinationComponent.MapInputColumn(oledbDestinationInput.ID, col.ID, exCol.ID);

}

Console.WriteLine("done");

Console.ReadKey();

// Save the package

//Application application = new Application();

//application.SaveToXml(@"c:OLEDBTransfer.dtsx", package, null);



}


While debugging, I'm getting exception (ELEMENTNOTFOUND) at this line

IDTSExternalMetadataColumn90 exCol = oledbDestinationInput.ExternalMetadataColumnCollection[col.Name];

because metadata have no appropriate column to map with the destination component.

Any one help me to resolve this issue.

Regards,
kris

View 1 Replies View Related

Creating A Package Of Dtsx Packages

Jan 23, 2007

Hi



I am trying to build a package that is comprised of 100+ dtsx packages but cannot seem to get it to work. I have created a new connection where the connectionmanagertype = file and the file path is equal to the folder in which my dtsx files are located. I (location = fileSystem). No matter what I do I get an access denied error that shows the folder location but no package. I manually typed the name of the package in the PackageName property and have pasted in the PackageID in the appropriate property as well but I don't see anything in the PackageNameReadOnly. I have read the MSDN information but I don't see a step by step way to build a package of packages against which I can compare. Can anyone set me straight?



Thanks.

Robin

View 17 Replies View Related

Moving Csv File From One Folder To Another Folder

Mar 28, 2008

I am having problem with moving a file from one folder to another folder. Here is the detailed scenario:

I want to move a input.csv file from shared input folder to shared archive folder. i am using the below code to do this.
declare @inpath varchar(100)
SET @inpath = 'move "\abcdefINPUTinput*.csv" "\abcdefARCHIVEarchive.csv"'
EXEC @filestatus = master..xp_cmdshell @inpath
but the problem was it was cutting the input.csv file from INPUT folder but not pasting it in the ARCHIVE folder.
I really appreciate if anyone can help me to solve this or anyone can tell some workarounds.

Thanks,

View 20 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved