dbTalk Databases Forums  

Importing Query From .sql file?

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


Discuss Importing Query From .sql file? in the microsoft.public.sqlserver.dts forum.



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

Default Importing Query From .sql file? - 06-24-2008 , 08:37 AM






Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
..txt file using dts 2000.......



Hey ...give any comments.........yes, no, possible, not
possible....anything.........


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

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM






On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


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

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


Reply With Quote
  #4  
Old   
matteus
 
Posts: n/a

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


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

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


Reply With Quote
  #6  
Old   
matteus
 
Posts: n/a

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


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

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


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

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


Reply With Quote
  #9  
Old   
matteus
 
Posts: n/a

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:11 AM



On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........
For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.


Reply With Quote
  #10  
Old   
vaib
 
Posts: n/a

Default Re: Importing Query From .sql file? - 06-24-2008 , 11:49 PM





"matteus" wrote:

Quote:
On Jun 24, 3:37 pm, vaib <v... (AT) discussions (DOT) microsoft.com> wrote:
Hi
can u tell me how to fetch query from .sql file while working in DTS 2000?

actually, I need to fetch query from . sql file(on local drive) and then
want to execute this query on a sql database to export that sql data to a
.txt file using dts 2000.......

Hey ...give any comments.........yes, no, possible, not
possible....anything.........

For what i know anything is possible and there're always a plenty
of ways to perform something.
In your case i would prefer using bcp.exe

But if you want to use DTS at any cost you should build a new package,
then:
- add an oledb connection to your server,
- add an execute sql task that uses this connection
- add a dynamic properties task that sets the sql statement of the
previous task to your .sql file
This task must be created after the execute sql task, but must
obviously be run before it

bye,
M.
----------------------------------------------------------------------
Hi M.
thanks 4 suggestions.......

actually i need to insert some data into text file taking it from sql
server........
i hv done it using "transform data task" making an ole db connection where i
wrote the required query into "transform data task" for fetching the data
from sql table and dumped the query result in a text file.........
Nw wt i want is .............
1. I need to fetch the same query from some .txt or .sql file in C:
Drive..........
2. soit means i dont want to write the whole query in dts package.......
3. i need to read it from an external file on my local drive.........
4. and then run this query in my dts package.......
5. dumping the result of this query in a text file......
I hv to use only dts.......
Help plz......thanks again 4 replying......


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.