Sunday, February 12, 2012

Can I make DTS..........

Can I make a DTS package that its destination place can be variable/input?
Because I want its DTS package can be called by each client to export
client's data. (client's data use Foxpro).
Or May I make Stored procedure to instead it? Give me solution? And give me
its listing code? or not, give me some refferences to be learned by me.Adi,
Yes it's possible. Here is the procedure
1) Create two global variables in your DTS package one each for
destination server and destination database (assuming your destination
is SQL Server) say strServer & strDB
2) Have dynamic propeties task object positioned at the begining in
your package (u need to have this before destination connection in
order) , this task can be used to assign values present in the global
variables to various DTS objects , in your case it will be destination
connection object.
Check BOL or www.sqldts.com for reference on dynamic properties task or
global variables.
3)Now, we can pass different values to these global variables during
run time using SQLAgent Job.Create separate job for each client, you
can call same DTS package thru different jobs and pass different values
for global variables.
eg:dtsrun /E /N"<packageName>" /S<Server Name> /A "<Global Variable
name eg: strServerName>":"8"="<Actual Server Name>" /A "<Global
Variable name eg: dbName>":"8"="<Actual dbName>"
check for dtsrun utility in SQL Server BOL or sqldts.com

No comments:

Post a Comment