Changing Source Filename In DTS

Dec 15, 2005

Hi!

Is there a way I can make the source file in my DTS dynamic so that every time I run it using ASP I can tell it which file to use?

View 1 Replies


ADVERTISEMENT

Changing 'Filename' Attri. When Creating Databases

Jul 13, 2006

Obadiah writes "hello,

I am a newbie to developing .net applications unfortunately my boss and my colleaques think i am a pro (interview went too well) and i would like to get at least this months paycheck before am fired....so i here's my dumb question:

I want to create a SQL database from my vb.net application using stored procedures, however i want to be able to set the Filename attribute ('Filename = C:Program FilesMicrosoft SQL ServerMSSQL$SARDONYXINSTANCEData estdb.mdf') by means of a input parameter to the stored procedure. like so...
Filename = @databasepath.

HERE is what i have:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE PROCEDURE rico_dbasescript
@Databasepath varchar(100) = 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdb.mdf' , @Databaselogpath varchar(100)= 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdblog.ldf'
AS

IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Sardonyxrioctestdb')
DROP DATABASE [Sardonyxrioctestdb]



CREATE DATABASE Sardonyxrioctestdb
ON
( NAME = 'Sardonyxrioctestdb_dat',
FILENAME = @Databasepath,
--FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdb.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sardonyxrioctestdb_log',
FILENAME = @Databaselogpath,
--FILENAME ='c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdblog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
GO


The above procedure works fine when Filename = 'c:program filesmicrosoft sql servermssql$sardonyxinstancedataSardonyxrioctestdb.mdf'
but bombs out when Filename = @Databaselogpath.

Thank you in advance."

View 2 Replies View Related

XML Source With Schema Filename In Variable.

Aug 13, 2007

Is there a way to configure the XML source component to use a schema file whose filename is in a variable? Now I know it doesn't make any sense to have an XML source whose schema can vary, however, I have a parent package with a ton of child packages, all of which process the same XML input using the same schema. What I would like to do is for the parent to load the filename of the XML input file into a variable, and the filename of the XML schema file into another. Each child would have its XML source configured to pickup these variables from the parent, so that if the location or name of the schema changes, I don't have to edit each package one-by-one. However, it doesn't seem possible to specify anything but a filename for the schema. Any suggestions?

View 5 Replies View Related

Assign Variable For FileName Of Source File

Aug 10, 2006

I am wanting to capture the file name I am using to load data from and use it in a SQL statement to insert it along with the data that I load.

I am using a ForEach container to load all my .txt files but cannot figure out how to capture the name of each source file as it loops through the files and then add it to my insert statement that is populating my history table. I would think that the ForEach container has that information, but I do not see how to access it and assign it to a variable that I could use in my SQL statement.

Any ideas or suggestions?

View 4 Replies View Related

SSIS: Flat File Source With Wildcarded Filename

Aug 14, 2007

My task is to write an SSIS package that picks up just one file from a directory and loads it into a database table. The filename is defined as being "ABC*.txt". So I must pick up only one file that matches that wildcard.

I can see two ways of doing this, but I can't get either to work:-
1. Use a Flat File Source connection and put the wildcard in the ConnectionString.
i.e. ConnectionString = "C:\mydirABC*.txt"
But SSIS doesn't seem to support that.
2. Use a Foreach Loop Container with a Foreach File Enumerator, and configure the enumerator as:-
Folder = c:mydir
Files = ABC*.txt
This works well, but loops round for as many files match the wildcard. Is there any way of forcing it to drop out after the first time round the loop?

Or am I missing a much easier solution?
Thanks.

View 10 Replies View Related

How To Pass Filename As A Dynamic Variable To Flat File Source In SSIS ?

Sep 3, 2007

Hi,

I am migrating one of my DTS package to SSIS.

My task is to read the filename from a database table and transfer the flat file data in to a table.
In SSIS,I am able to fetch the file name using a Data Reader Source; but how to pass this fileName parameter to Flat File Source ?

In DTS I have used ActiveX script to pass filename variable as flatfilecon.Source.
Any help ?

Thanks,
Ravi

View 4 Replies View Related

Using ForEach And Pass Filename To Flat File Source In Data Flow Task

Mar 11, 2008

How do i use the foreach loop container and pass each file found according to a specified pattern to a Flat File Source in a Data Flow Task Object so i can operate on each file found in the foreach loop object instead of having to specify a static file name

Thanks

View 4 Replies View Related

How To Concatenate Variables For RAW Output Filename I.e.@path + @filename?

Sep 7, 2007

Doesn't appear you can do this.

Am I wrong?

Please tell me I am.

View 11 Replies View Related

Changing The Source Wth A Button

Feb 4, 2007

Hi,
I have this Gridview in which I show attendees to a course (per course)
In the same gridview I want to be able (by clicking a button) to show all attendees to all courses simply by leaving out a part of the SQL;
WHERE Eventid = @eventid (resulting in all attendees no matter what course)
In other words how can I alter the selectcommand of the SQLDataSource?
Seems simple, but can't hack it.
Thanks in advance,
Lx 

View 3 Replies View Related

Changing Source File Name In DTS Through ASP

Dec 15, 2005

Hi!

Is there a way I can make the source file in my DTS dynamic so that every time I run it using ASP I can tell it which file to use?


$3.99/yr .COM!
http://www.greatdomains4less.com

View 2 Replies View Related

Dynamic Database Source Changing

May 2, 2006

Hi,

I am building a data warehouse for a customer who has systems located in two different countries.

I need to import that data from four seperate databases, which all share the same structure.

To do this i have created 20 packages to import that data from the source database. What i would like to do, is at run time set which database the SSIS package should get its data from.

In sql 2k this was easy with a global variable that was set, then use a dynamic properties task to set the data source.

How can i achieve the same result in SSIS? the data source is an ODBC connection, with the four ODBC connections having similar names, eg ABC_NZ, ABC_AU

Thanks in Advance!

Truby

View 6 Replies View Related

Changing XML Source To A Variable At Runtime

Apr 12, 2007

Hiya guys,



The question:

Can I design data flows with an XML Source pointing to file system xml files, and but run them against variables? I can see the properties at design time (Accessmode=0,1,2; XMLDataVar="User::XMLData), but the XMLSource object doesn't appear to have expressions enabled to change this at runtime, nor do these properties seem to be exposed to configurations.



The scenario:

I have a package that reads through (potentially thousands) of XML files, and having identified the embedded message "type", transforms them via XSLT to an easier XML format (XML Datasource can't cope well with multiple namespaces etc). Then send this the new file off to a type specific dataflow task to send contents to database.



For performance (and other) reasons I'd rather XSLT to a single shared variable and use this variable as the XML source in the data flows (Rather than writing out to the filesystem [via xslt] and immediately reading it back in each time [via datasource]).

But designing the data flow task using a variable as xml source is frustrating for a bunch of reasons - not the least being:

(a) The variable needs to be populated with sample xml data at design time. But this could only ever match one dataflow at a time (fine at run time, but painful at designtime - leading to validation errors popping up all around the place.)

Yes I could have a seperate variable for each xmlsource - but that just makes things more complicated up front and also leaves me with 20+ large, type specific, xml variables floating around at runtime of which only one is ever being used per import - which just doesn't feel right to me.



(b) populating the variable with sample xml at design time is painful due to it being a string - and not accepting hard returns etc that are in text files, design time changes etc)



Using a file XML source at design time is infinitely easier, when I get a design time change - I can just amend the XSLT and run the appropriate task to produce a sample XML file to design against.



Any ideas?

Ta.

Gus.

View 2 Replies View Related

Changing Connection String To Data Source

Sep 4, 2007

Can I change databases for a SqlDataSource in code behind and still use the edit,inset,delete capabilities of the SQLDataSource control?

View 1 Replies View Related

Changing Data Source Of Existing Cube

Dec 25, 2006

Hi Guys,

We had existing cubes in our Analysis Server, we were required to move them on another Reporting Server which would be using Data Replicated every night to that server. Problem is now source data is divided into 2 Reporting Database Servers. Table Names/View Names are the same in all the Databases. I just want to change the data source pointing to existing Database to the new Reporting Server. Can you tell me how this can be achieved?

Regards,

Kaushal



View 3 Replies View Related

Changing DataTypes In An Excel Data Source

Jun 7, 2006

Hello.

I'm importing some data from an excel file to sql server 2005.

I created an Excel Data Source inside my Data Flow Task but it is assuming that the source columns DataType is double-precision float [DT_R8]. It isn't, even though some rows may containg numeric string in the column's cell.

If I go to the Data Sources advanded editor, and modify the data type property of the column, SSIS complains the the error output and the source output are not of the same DataType. If I try to change the error output's data type in the advanced editor I get this error: "Property Value". The deailed error states:

Error at MOVIM 04 [MOVIM 04 [1]]: The data type for "output "Excel Source Error Output" (10)" cannot be modified in the error "output column "Agente Protector" (7662)".

Error at MOVIM 04 [MOVIM 04 [1]]: Failed to set property "DataType" on "output column "Agente Protector" (7662)".

If i let SSIS correct the error by itself, it changed the dource column back to double-precision float [DT_R8].

Is there any way to get arround this?

Thanks in advance,

Hugo Oliveira

View 11 Replies View Related

Error When Changing The Length On DataReader Source

Nov 3, 2006

Hi,
I am trying to import data from Oracle RDB into SQL Server 2005 using SSIS. Created a ODBC data source to connect to Oracle and used DataReader Source component and ADO.net to connect to the ODBC data source.

Under the Component properties tab, the SQL Command looks something like this.

Select ID, ADDRESS, REVISED from ADDRESS

The data type for the source columns are Integer, Varchar(30) and DATE VMS.

Now when I look at the Input and Output properties window,

The External columns has the following data types.

ID - four-byte signed integer [DT_I4]
ADDRESS - Unicode string [DT_WSTR], length = 0
REVISED - database timestamp [DT_DBTIMESTAMP]

The Output columns has the following data types

ID - four-byte signed integer [DT_I4]
ADDRESS - Unicode string [DT_WSTR], length = 0
REVISED - database timestamp [DT_DBTIMESTAMP]

When I tried to change the length of the ADDRESS on the output column, I get the following error.

Error at Data Flow Task [DataReader Source [1]]: The data type of output columns on the component "DataReader Source" (1) cannot be changed.

Error at Data Flow Task [DataReader Source [1]]: System.Runtime.InteropServices.COMException (0xC020837D)
at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.SetOutputColumnDataTypeProperties(Int32 iOutputID, Int32 iOutputColumnID, DataType eDataType, Int32 iLength, Int32 iPrecision, Int32 iScale, Int32 iCodePage)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostSetOutputColumnDataTypeProperties(IDTSManagedComponentWrapper90 wrapper, Int32 iOutputID, Int32 iOutputColumnID, DataType eDataType, Int32 iLength, Int32 iPrecision, Int32 iScale, Int32 iCodePage)

Is this the default length for the Unicode string type. I was not able to load the ADDRESS column as it gets truncated before I load it into destination. Even if I use Derived or Data Conversion transformation, the ADDRESS is getting truncated before it reaches this transformation.

Any thoughts.

Thanks,
SK

View 8 Replies View Related

Manually Changing Flat File Source Has No Effect

Jul 5, 2006

I have a data flow that reads from a flat file source, goes through one data transformation component to change from unicode to normal text and writes the data to a SQL Server table.  This has been working fine throughout development using a specific source file as input.  I have now manually changed the path and name of the input source file in the connection manager to point to a new file and the task continues to process the old text file.

I open the connection manager and check its properties and preview the data and it all looks fine - it is finding the new file.  I also edit the flat file source component and preview the data and it shows the data from the new file.  I run the data flow by right-clicking and selecting Execute Container and it continually reads the old file and processes it!  (I do the right-click thing because this is just one small part of a larger package.)

This has got to be a bug, but just where I wonder.  Anyone ever see this before?  I'm going to try to run the entire package in debug mode, instead of right-clicking, next and see if that's any different.  Anyone have any ideas on how to force a refresh of the necessary internal components to make it read the new file?  All the external properties point to the new file, but it's not being read.

Joe

 

Update:

I ran the entire package and found no difference in execution - it's still reading the wrong input file.  I then deleted and recreated the connection manager, again specifying the new file to read.  It still continued to read the old file.  I deleted the flat file source component and recreated it, specifying the latest connection manager (twice, since I must have pointed it at the wrong one the first time and it read a completely different file).  I still have the same problem of it reading the wrong input file.  I don't know what else to recreate that would have any effect.  Does anyone have any ideas?  I need to change the pointer to different files multiple times and have it read several different input files.  This has got to work somehow.  Any help is appreciated.

Joe

View 3 Replies View Related

SSIS Execution Error: FlatFile Connection Problem - FileName &&<fileName&&> Specified In The Connection Was Not Valid.

Apr 19, 2008



Hi Champs,

Scenario Configuration : VB.net 2005 Code, WebService for Executing SSIS on Server, SSIS deployed on the Database Server

Problem Description : We are developing windows applicaiton in which we call webservice which was deployed on the same server where SSIS packages are deployed.
Now from Code we are passing FilePath name in variable and execute the Package. But the SSis result says that
The file name "\computernamefol1fol2fol3fol4abc.txt" specified in the connection was not valid.

More Information:

1. Full Permission are given on this network folder.
2. Package executes successfully from SSIS development solution (BIS solution)
3. Deployed packed executes successfully from the Database Server.
4. From Development pc packege executes successfully.
5. Other packages deployed on the same server executed suucessfully with same configuration and scenario.

Only this package is not executing.


-- the only differece with this package with other is -

using ".txt" extension in Flat file connection and using VB Script task


Can any one suggest the appropirate solution for this problem...

Thanks
Tarang Pandya

View 21 Replies View Related

Integration Services :: How To Handle Dynamically Changing Source Columns

Jun 29, 2015

I have a scenario where we have to handle dynamically changing source columns.

For example , some times in the source files the number of columns will be increased or decreased, new columns can be added in the middle or in the end of the source file.

How to handle this kind of scenario in the SSIS ?

View 9 Replies View Related

SSIS - Slowly Changing Dimension - Detect Deleted Rows From The Source

Nov 22, 2007



Hi all,

Can you help me to resolve my problem ? I have to do a simple daily backup system. Source : Flat File; Destination : SQL Server. I want to use the Slowly Changing Dimension component to backup only the new and updated row from my source (Flat File) and put them into SQL Server.

But how can I do to detect deleted rows from my source ?

Any suggestions ?

If it's not clear enough, please ask for more details !

GO

View 3 Replies View Related

Integration Services :: Dynamic SIS Package Changing Source Connection At Run Time

Jul 30, 2015

I am in between of creating a dynamic SSSIS package which will run for multiple zones having different source connection.My source is in Oracle.I am having 3 DFT with the 3 different source tables.I want to create a package with above DFT dynamically so that my single package can run for the entire zone with dynamically source connection change.I have created a Master table which stores the zone source connection string and zone name. I have 2 different connection.so if in future any new zones come so only newly zone details need to be add in master table without opening the package.

View 3 Replies View Related

Reporting Services :: Changing Credential Used For SSRS Data Source Programmatically

Jun 15, 2015

I am looking command (cmd/powershell/c#) for setting/updating credential for SSRS data source.

View 2 Replies View Related

Integration Services :: Package Failed After Changing Password In Shared Data Source

Jun 19, 2015

I'm using a shared data source to connect an Oracle server in my packages.  After changing the database user password in the shared data source, I noticed the package concerned would fail with the following description.

Source: "OraOLEDB"  Hresult: 0x80004005  Description: "ORA-01017: invalid username/password; logon denied".

Is there a way to ensure the packages will use the latest information in the shared data source?  I did do a Rebuild before executing the packages.

View 5 Replies View Related

T-SQL (SS2K8) :: Load Data From Flat File Source Into OleDB Destination By Changing Data Types In SSIS

Apr 16, 2014

I have an source file and i have to load it into the data base by changing datatype of the columns in ssis

View 1 Replies View Related

Changing Data Source Programatically Does Not Transfer Data

Aug 29, 2006

I have created a SSIS package that transfer data from a Foxpro database to an instance of SQL Server 2005 Express. I used the wizard to create the package but I load and execute the package within a custom application that I have written in C#.

The way the custom application is intended to work is that the user can have the database in any location on the computer and all he has to do is specify the location then the application programatically changes the location of the source on the package that it has loaded and then execute it. When I initially run the package the first time (using the original path), it works fine and transfers the data. However, every subsequent time I run the application and specify a different path, the database on the SQL Server side gets created as expected but the data is not transfered!

Where am I going wrong? Do I need to save the package after I modify the source then reload and run it again or do i need to change something else in the Data Flow to make this work?

View 4 Replies View Related

Get Just Filename

May 23, 2008

If you use "SELECT filename FROM sys.sysdatabases" this will return
the full path , such as "E:MSSQLdatamyData.MDF" ,

is it possible to return just the "myData.MDF" part of it?
I know that you can parse the string , but is it stored somewhere else , or is there a command that will return just the physical file name ?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com

View 1 Replies View Related

Add Seq# To Filename

Mar 25, 2008

Hi Guys, got a question that I'm not sure there is an answer to other than 'No Way'.

I have to export a file whose filename must include a sequence number. I have created the table to hold the seq# and the code to increment it. My problem is how do I include the seq# in the output filename. I am using the Flat File Destination tool for exporting. should I be using another tool?

Any suggestions?

Thanx,
Trudye

View 2 Replies View Related

Logical Filename

Jun 19, 2002

Hello,

Is there any way to change the logical filename of exsiting database

Thanks
Lara

View 1 Replies View Related

Getting FILENAME Into @variable In SQL

Oct 10, 2001

Does anyone know how to execute a directory listing of a file and return the file name to a variable in SQL? For instance, there's a file called c:datach20011010.txt and i execute the following:
xp_cmdshell 'dir  c:datach*.txt'

or any other transact sql or procedure, how can i get the filename into a variable...all in sql?

FYI - I need to pass a filename to a process so that it can bcp the data into a temp table. But I don't know the filename at the time the process is setup/scheduled.

TIA,
Mike Nolen

View 3 Replies View Related

Get Filename Dynamiccaly

Jul 26, 2007

Hi,
I am using a foreach loop to go through the .txt files inside a folder.
Using a variable I can pickup the filenames the loop is going through.
At present there is a sql task inside the foreach loop which takes the filename as a parameter and passes this filename to a stored procedure.
Now I would like to add one extra step before this sql task. Would like to have a dataflow with flatfile source which connects to oledb destination.

The question is:
While in the loop, how is it possible to pass the filename to the flatfile source using the FileName variable which I have created?

Please note, this is a different question to my other post.

Many Thanks

View 1 Replies View Related

Ssis - Filename

Jul 26, 2007

Hi,
I think I may have mis-guided some of you in my previous post.
So I thought I explain it properly this time in a new post...

Here is the description of the ssis package:

Inside the connection manager there is a connection to the sql server database and a flat file connection.

The flat file connection inside the connection manager has the expression set
i.e. ConnectionString set to @[User::FileName]

And so there is nothing inside the connectionstring property of this flatfile connection.

Inside control flow:

1)

Dataflow which contains a flat file source and an ole db destination

The flatfile source is supposed to pickup the .csv file that gets passed to the ssis package.
Then the ole db destination is where the .csv gets imported into a sql server table.

2)

Back in the control flow, there is a task that calls a stored procedure with the parameter which is set to FileName

The question is:
How does this FileName parameter gets set before it is passed to the stored procedure?

Many thanks

View 1 Replies View Related

How To Read Filename

Mar 28, 2008

HI,

I am writing data from a file in to a table and i have a field in that table for filename. How to read the file name to write in that table.

Thanks in advance.

View 4 Replies View Related

Get Filename Dynamically

Jul 26, 2007



Hi,
Using a ssis package I have several tasks.
A variable is also created called FileName.
There is a flat file connection called InputFileName.
initially when I designed the package, I hardcoded the pass of one of the .csv files into the path of the flatfile connection.

There is a dataflow which has flatfile source and oledb destination. These two basically pickup the file and import into the database using mapping.

So therefore the package works and data gets imported into the database.

Then I used the variable to make the filename dynamic. So I removed the hardcoded connectionstring in the InputFileName.

Is this the right thing to do to make the package dynamic? I would like to pass in any .csv filename and so the package runs.
My question is now that the connectionstring is deleted but instead placed an expression for the filename, then how does the system know which file to use?

Thanks

View 1 Replies View Related







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