Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query results to a file within a DTS package?

Status
Not open for further replies.

dimbulbz

Technical User
Joined
May 23, 2001
Messages
5
Location
US
This ought to be an easy answer, but how do you send 'results to file' query results without being prompted for the file name? I would like to send a DBCC showcontig to a flat file, then import it into SQL using a DTS package. But I cant seem to get the DBCC results to go directly to a file, without being prompted for what to name the file - that wont work in a DTS package.

Thanks for your help!
dimbulbz@hotmail.com


Jim Johnston
dimbulbz@earthlink.net
jim.johnston@checmail.com
 
Try this on for size ... you can even create a step in your DTS package to run it.


master..xp_cmdshell 'osql -Usa -Ppassword -q"DBCC showcontig " -dDatabaseName -oc:\DBCC_output.txt'


Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top