Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Need script to load into text file from sql server

Author  Topic 

hardikkumar
Starting Member

14 Posts

Posted - 2013-11-15 : 12:40:25
Hi I need script to export text file from sql. I cannot use importexoprt and bcp.give me script.

Below are field lmatter,ibilldt,ipaydt

hardik

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-11-15 : 13:01:46
You have a text file stored in SQL server and you want to export it? Or do you want to save the results of a query to a text file?
Go to Top of Page

hardikkumar
Starting Member

14 Posts

Posted - 2013-11-15 : 13:54:59
I want to save the query result of a query to a text file.

Thanks for reply

hardik
Go to Top of Page

djj55
Constraint Violating Yak Guru

352 Posts

Posted - 2013-11-15 : 14:16:45
Is this a query you run with a stored procedure or in SSMS?

djj
Go to Top of Page

hardikkumar
Starting Member

14 Posts

Posted - 2013-11-15 : 14:22:59
select b.lmatter , convert(char(10),max(ltradat),101) lbilldt,
( select convert(char(10),max(ltradat),101)
from ledger, ledcode
where lmatter = b.lmatter
and ldocumnt is not null
and lzero != 'R'
and llcode = lccode
and lccollhs = 'Y'
) lpaydt
from ledger b, ledcode
where ldocumnt is null
and lzero != 'R'
and llcode = lccode
and lcfco != 'I'
group by lmatter
order by lmatter



I am running this query and its result should export to text file by script.

hardik
Go to Top of Page

hardikkumar
Starting Member

14 Posts

Posted - 2013-11-15 : 15:05:06
I have to put this script on task manager so whenever it run this script it should export all data to txt files.

Please give me some ideas on it.I cant use import export wizard and bcp because I have to run on task manager or if you have any ideas with this option please let me know.

Thanks

hardik
Go to Top of Page

hardikkumar
Starting Member

14 Posts

Posted - 2013-11-15 : 16:13:53
need help

hardik
Go to Top of Page
   

- Advertisement -