dbTalk Databases Forums  

Assign value to Global Variable

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


Discuss Assign value to Global Variable in the microsoft.public.sqlserver.dts forum.



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

Default Assign value to Global Variable - 03-16-2005 , 09:59 AM






I am creating a DTS package to import from a txt file (YYYYMMDD.TXT)
to a table in SQL 2000 Database.

Here are the steps I am using:

1. I create my package using file 20050314.txt as source. It works
fine.

2. Next, I add global variable "MYFile".

3. I add Dynamic Property task and assign property "SourceObjectName"
the
value "MyFile"

4. I add Workflow, On Success to link the Dynamic Properties Task to
the Source Object.

5. When I run this DTS from the stored procedure using the /A switch
it still imports the test file 20050314.txt (No errors)

I am using the syntax:

set @MyStr = 'dtsrun /Sx /Nx /Ux /Px /AMyFile=' + @FilePath
exec master..xp_cmdshell @MyStr

-- @FilePath = full-path of the txt file


PLEASE HELP!

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

Default Re: Assign value to Global Variable - 03-16-2005 , 01:24 PM






You want to change the DataSource property of the Text File connection



"Jayesh Shah" <jayeshm53 (AT) hotmail (DOT) com> wrote


Quote:
I am creating a DTS package to import from a txt file (YYYYMMDD.TXT)
to a table in SQL 2000 Database.

Here are the steps I am using:

1. I create my package using file 20050314.txt as source. It works
fine.

2. Next, I add global variable "MYFile".

3. I add Dynamic Property task and assign property "SourceObjectName"
the
value "MyFile"

4. I add Workflow, On Success to link the Dynamic Properties Task to
the Source Object.

5. When I run this DTS from the stored procedure using the /A switch
it still imports the test file 20050314.txt (No errors)

I am using the syntax:

set @MyStr = 'dtsrun /Sx /Nx /Ux /Px /AMyFile=' + @FilePath
exec master..xp_cmdshell @MyStr

-- @FilePath = full-path of the txt file


PLEASE HELP!


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.