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 2000 Forums
 Import/Export (DTS) and Replication (2000)
 pass from stored procedure to folder

Author  Topic 

Trent
Starting Member

39 Posts

Posted - 2004-10-21 : 11:48:38
Is there any tSQL code that sends its output to say a fileshare on a server?

Kristen
Test

22859 Posts

Posted - 2004-10-21 : 12:07:37
DO you want to run some SQL that runs on the SQL box, and the output from that is stored to a file that the SQL box has access to?

Or some other problem?

Kristen
Go to Top of Page

Trent
Starting Member

39 Posts

Posted - 2004-10-21 : 13:22:33
Yes, that's what I'd like to do.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-10-21 : 13:37:42
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=39009

looks like I came up with a similar answer, and some other thoughts:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=37684

or rockmoose in:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=37513

Capture error in proc
RAISERROR(.....) WITH LOG
Then look in the Application Log

Kristen
Go to Top of Page

Trent
Starting Member

39 Posts

Posted - 2004-10-21 : 13:58:54
So if I had something like this:
SELECT TesterID, LastName, FirstName....
How would I send those to some destination?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-10-21 : 14:22:25
With a cursor <Spit!> so that you could ECHO each result to a [append to a] file using xp_cmdshell.

Better would be to put them in some sort of temporary table and then use xp_cmdshell to run BCP to export that table to a file.

But its jolly hard work for very little gain - are you sure you need to do it this way about? What's the problem you need to solve?

Kristen
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-10-21 : 14:45:17
Hey! Guess what?

Tara, a Godess of this parish, has been busy answering a similar problem in another thread. Here you go:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=41503

Kristen
Go to Top of Page

Trent
Starting Member

39 Posts

Posted - 2004-10-22 : 11:45:53
Thank you!!!!
Go to Top of Page
   

- Advertisement -