dbTalk Databases Forums  

Dynamic DataBase

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Dynamic DataBase in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Elizabeth
 
Posts: n/a

Default Dynamic DataBase - 09-12-2005 , 02:51 PM






Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual basic) goes
like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the original data base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Dynamic DataBase - 09-12-2005 , 03:23 PM






Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote


Quote:
Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual basic) goes
like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the original data
base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth


Reply With Quote
  #3  
Old   
Elizabeth
 
Posts: n/a

Default Re: Dynamic DataBase - 09-13-2005 , 11:43 AM



I export the data into a flat file.
I know that the connection has not changed because I can check the data and
see that the DTS is taking the data from the DataBase that was defined when I
built the DTS (using the Export wizard). I know that it's the right
connection because if I change the other one (there are only two) I get the
flat file not where I expected it to be.

Many thanks in advance
--
Elizabeth


"Allan Mitchell" wrote:

Quote:
Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com:

Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual basic) goes
like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the original data
base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth



Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Dynamic DataBase - 09-13-2005 , 02:14 PM



OK so we are obviously in the right package and we can obviously change
connections but it would appear not this one.

We will need to find out to where the package thinks it points.

To do this, change your package and add an active Script task as the
very last thing. Add a package log to text file.

Now do this in the function inside the task


DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").DataSource
DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").Catalog


In the log that is written by the package you will now be able to see
what the package thought happened.

Allan



"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote


Quote:
I export the data into a flat file.
I know that the connection has not changed because I can check the data
and
see that the DTS is taking the data from the DataBase that was defined
when I
built the DTS (using the Export wizard). I know that it's the right
connection because if I change the other one (there are only two) I get
the
flat file not where I expected it to be.

Many thanks in advance
--
Elizabeth


"Allan Mitchell" wrote:


Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com:


Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual basic)
goes
like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the original
data
base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth





Reply With Quote
  #5  
Old   
Elizabeth
 
Posts: n/a

Default Re: Dynamic DataBase - 09-14-2005 , 09:57 AM



Hi Allan,

First - it was a very good idea to add the log file - thank you.
Second, I don't know if it's good news or bad but the DataSource and the
Catalog are correct.
Still I don't get the right data.

I was thinking of trying to use the Dynamic Properties Task - what do you
think?

Many thanks,
--
Elizabeth


"Allan Mitchell" wrote:

Quote:
OK so we are obviously in the right package and we can obviously change
connections but it would appear not this one.

We will need to find out to where the package thinks it points.

To do this, change your package and add an active Script task as the
very last thing. Add a package log to text file.

Now do this in the function inside the task


DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").DataSource
DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").Catalog


In the log that is written by the package you will now be able to see
what the package thought happened.

Allan



"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com:

I export the data into a flat file.
I know that the connection has not changed because I can check the data
and
see that the DTS is taking the data from the DataBase that was defined
when I
built the DTS (using the Export wizard). I know that it's the right
connection because if I change the other one (there are only two) I get
the
flat file not where I expected it to be.

Many thanks in advance
--
Elizabeth


"Allan Mitchell" wrote:


Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com:


Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual basic)
goes
like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the original
data
base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth






Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Dynamic DataBase - 09-14-2005 , 01:32 PM



You could yes use a DP task to do the assignments but by all accounts
the assignments are happening anyway so I am not sure that this will fix
your problem.

If you do use a DP task, how do you intend to use it? I can then offer
ideas on the best way.

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote


Quote:
Hi Allan,

First - it was a very good idea to add the log file - thank you.
Second, I don't know if it's good news or bad but the DataSource and the
Catalog are correct.
Still I don't get the right data.

I was thinking of trying to use the Dynamic Properties Task - what do
you
think?

Many thanks,
--
Elizabeth


"Allan Mitchell" wrote:


OK so we are obviously in the right package and we can obviously
change
connections but it would appear not this one.

We will need to find out to where the package thinks it points.

To do this, change your package and add an active Script task as the
very last thing. Add a package log to text file.

Now do this in the function inside the task


DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").DataSource
DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").Catalog


In the log that is written by the package you will now be able to see
what the package thought happened.

Allan



"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com:


I export the data into a flat file.
I know that the connection has not changed because I can check the
data
and
see that the DTS is taking the data from the DataBase that was
defined
when I
built the DTS (using the Export wizard). I know that it's the right
connection because if I change the other one (there are only two) I
get
the
flat file not where I expected it to be.

Many thanks in advance
--
Elizabeth


"Allan Mitchell" wrote:



Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal
number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com:



Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual
basic)

goes

like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the
original

data

base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth








Reply With Quote
  #7  
Old   
Elizabeth
 
Posts: n/a

Default Re: Dynamic DataBase - 09-15-2005 , 01:16 PM



As I am new to DTS programming I will have to learn more about DP task.

Any suggestions are mostly welcome.
--
Elizabeth


"Allan Mitchell" wrote:

Quote:
You could yes use a DP task to do the assignments but by all accounts
the assignments are happening anyway so I am not sure that this will fix
your problem.

If you do use a DP task, how do you intend to use it? I can then offer
ideas on the best way.

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:A9A16670-4698-44AA-838E-EA4D303B79B2 (AT) microsoft (DOT) com:

Hi Allan,

First - it was a very good idea to add the log file - thank you.
Second, I don't know if it's good news or bad but the DataSource and the
Catalog are correct.
Still I don't get the right data.

I was thinking of trying to use the Dynamic Properties Task - what do
you
think?

Many thanks,
--
Elizabeth


"Allan Mitchell" wrote:


OK so we are obviously in the right package and we can obviously
change
connections but it would appear not this one.

We will need to find out to where the package thinks it points.

To do this, change your package and add an active Script task as the
very last thing. Add a package log to text file.

Now do this in the function inside the task


DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").DataSource
DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").Catalog


In the log that is written by the package you will now be able to see
what the package thought happened.

Allan



"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com:


I export the data into a flat file.
I know that the connection has not changed because I can check the
data
and
see that the DTS is taking the data from the DataBase that was
defined
when I
built the DTS (using the Export wizard). I know that it's the right
connection because if I change the other one (there are only two) I
get
the
flat file not where I expected it to be.

Many thanks in advance
--
Elizabeth


"Allan Mitchell" wrote:



Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal
number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com:



Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual
basic)

goes

like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the
original

data

base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth









Reply With Quote
  #8  
Old   
Elizabeth
 
Posts: n/a

Default Re: Dynamic DataBase - 09-15-2005 , 03:18 PM



Beginners luck...
I got it!
I just added the code
MyPack.Tasks(1).Properties("SourceSQLStatement") = "Select * from [" +
sDataBase + "].[dbo].[myTable]"

And it worked!

Thanks for all the help!
--
Elizabeth


"Allan Mitchell" wrote:

Quote:
You could yes use a DP task to do the assignments but by all accounts
the assignments are happening anyway so I am not sure that this will fix
your problem.

If you do use a DP task, how do you intend to use it? I can then offer
ideas on the best way.

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:A9A16670-4698-44AA-838E-EA4D303B79B2 (AT) microsoft (DOT) com:

Hi Allan,

First - it was a very good idea to add the log file - thank you.
Second, I don't know if it's good news or bad but the DataSource and the
Catalog are correct.
Still I don't get the right data.

I was thinking of trying to use the Dynamic Properties Task - what do
you
think?

Many thanks,
--
Elizabeth


"Allan Mitchell" wrote:


OK so we are obviously in the right package and we can obviously
change
connections but it would appear not this one.

We will need to find out to where the package thinks it points.

To do this, change your package and add an active Script task as the
very last thing. Add a package log to text file.

Now do this in the function inside the task


DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").DataSource
DTSPackageLog.WriteStringToLog
DTSGlobalVariables.Parent.Connections("Name of connection").Catalog


In the log that is written by the package you will now be able to see
what the package thought happened.

Allan



"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com:


I export the data into a flat file.
I know that the connection has not changed because I can check the
data
and
see that the DTS is taking the data from the DataBase that was
defined
when I
built the DTS (using the Export wizard). I know that it's the right
connection because if I change the other one (there are only two) I
get
the
flat file not where I expected it to be.

Many thanks in advance
--
Elizabeth


"Allan Mitchell" wrote:



Are you sure you are changing the right connection?

Can you use the name of the connection instead of the ordinal
number?

What makes you say that the connectio nhas not changed?

Allan

"Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message
news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com:



Hi there,
I built a new DTS using the Export Wizard and saved it.
Now, in order to have the data base dynamic, my code (visual
basic)

goes

like this:

MyPack.LoadFromStorageFile Fname, passwrd
MyPack.Connections.item(1).DataSource = sServer
MyPack.Connections.item(1).Catalog = sDataBase

MyPack.Execute

But, it doesn't help. Still, the export is done from the
original

data

base
that I chose when I built the DTS.

What do I miss?

Many thanks
--
Elizabeth









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.