In article <OEiZPAjfDHA.892 (AT) TK2MSFTNGP12 (DOT) phx.gbl>, Sender
<user (AT) domain (DOT) com> writes
Quote:
I have created a package and saved it in a .dts file. Everything is working
fine. The packages copies the data from a table called Customers in a Excel
file. I copied the package to another SQL Sever machine which has the same
database. I can execute the package there also. So far so good.
Now here is the problem. For example, on my SQL Server the databasename is
"MY_DATABASE" and in another SQL Server (another machine) the databasename
is "YOUR_DATABASE" (however the name of the table i.e. CUSTOMERS is same in
both the databases) . How can I specify the DATABASE NAME when I execute a
package using DTSRUN utility.
Please tell me the steps.
Thanks. |
When calling DTSRUN you can use the /A parameter to set a global
variable in your package. You can then use the Dynamic Properties task
to set change a task property value and set it to a global variable
value.
So using /A pass a value of [databasename].[dbo].[Customers] into a
global variable, and use the Dynamic Properties task to set the
SourceObjectName property of your DataPump task with this global
variable.
You could just pass in the database name via /A and override the
connection's database (Catalog property) but for this to work you would
first have to use Disconnected Edit to change the DataPump tasks
SourceObjectName property and remove the database part from the object
name, as by default the DataPump task uses a three part name for the
SourceObjectName property.
Make sense?
If you want help with the dtsrun command line syntax, try the DTSRUNUI
tool. Just type DTSRUNUI in the Windows Run command box. Select the
package and click Advanced. Use the command line generation option
available.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org