dbTalk Databases Forums  

using dts to run a query file

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


Discuss using dts to run a query file in the microsoft.public.sqlserver.dts forum.



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

Default using dts to run a query file - 02-13-2004 , 08:35 AM






SQL2000

i have a query file called text.sql saved into a directory, this file
is recreated every night with new and updated info by another process.

if i open and run this file in query analyzer it works fine.

so what i now want to do is run the query in a dts package, i want the
package to use the text.sql file for its updating.

i am trying to make the task as automated as possible, at present the
only manual intervention is the opening of the file in query analyzer
and running it.

all ideas welcolm.

thanks

Reply With Quote
  #2  
Old   
K
 
Posts: n/a

Default RE: using dts to run a query file - 02-13-2004 , 09:31 AM






Hello Stephen

You can accomplish this with a dynamic properties task and a execute sql task (a database connection is implied). In the dynamic properties task, click add and choose you execute sql task after you expand the task node. On the right hand side doubleclick on the sqlstatement property and from the drop down menu choose Query

Hth
K

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

Default Re: using dts to run a query file - 02-13-2004 , 10:48 AM



you can easily use osql to execute the file in an ExecuteProcess task.(full
syntax in BOL)

You can pass in the name of the text file to the package on the cmd line by
using the /A switch (full syntax in BOL) to a Global Variable

You can then manipulate the text of the ExecuteProcess task using this

How to manipulate the Execute Process task.
(http://www.sqldts.com/default.aspx?251)

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Stephen Matthews" <smatthews (AT) burbidge (DOT) co.uk> wrote

Quote:
SQL2000

i have a query file called text.sql saved into a directory, this file
is recreated every night with new and updated info by another process.

if i open and run this file in query analyzer it works fine.

so what i now want to do is run the query in a dts package, i want the
package to use the text.sql file for its updating.

i am trying to make the task as automated as possible, at present the
only manual intervention is the opening of the file in query analyzer
and running it.

all ideas welcolm.

thanks



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.