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.
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,ipaydthardik |
|
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? |
|
|
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 replyhardik |
|
|
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 |
|
|
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') lpaydtfrom ledger b, ledcodewhere ldocumnt is nulland lzero != 'R'and llcode = lccodeand lcfco != 'I'group by lmatterorder by lmatterI am running this query and its result should export to text file by script.hardik |
|
|
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.Thankshardik |
|
|
hardikkumar
Starting Member
14 Posts |
Posted - 2013-11-15 : 16:13:53
|
need helphardik |
|
|
|
|
|