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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem with xp_cmdshell
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cms9651
Starting Member

28 Posts

Posted - 01/23/2013 :  06:04:10  Show Profile  Reply with Quote
Hi there, hope in your help.
I need to save in my hard disk the txt file generated with this code, can you help me?
thank you.

The error is:
quote:
“The configuration option ‘xp_cmdshell’ does not exist, or it may be an advanced option.”



EXEC sp_configure 'xp_cmdshell';

EXEC xp_cmdshell 'bcp "SELECT
	*
FROM
	tkt
" queryout "c:\temp\test.txt" -T -c -t,';

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 01/23/2013 :  08:26:34  Show Profile  Visit jackv's Homepage  Reply with Quote
Try :
EXEC sp_configure ‘show advanced options’, 1
GO
RECONFIGURE
GO
EXEC sp_configure ‘xp_cmdshell’, 1
GO
RECONFIGURE



Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

cms9651
Starting Member

28 Posts

Posted - 01/23/2013 :  08:46:18  Show Profile  Reply with Quote
thank you!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000