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 2005 Forums
 Transact-SQL (2005)
 How to write to text file in SQL2005

Author  Topic 

sudip678
Starting Member

3 Posts

Posted - 2008-07-22 : 07:33:53
hi,
I would like the contents of my select query to be redirected to a text file.
I have heard about the xp_cmdshell stored procedure but it is blocked in SQL 2005 and my SQL Admin would not want to unblock it.
Is there any other way to acheive the desired result?

Thanks
Sudip.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-22 : 08:01:27
use ssms export/import task with source as your query and destination as text file.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-22 : 23:33:22
Or run query with sqlcmd in dos prompt.
Go to Top of Page
   

- Advertisement -