|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 5:01 AM
Points: 42,
Visits: 121
|
|
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:
“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,';
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Thursday, January 24, 2013 3:51 AM
Points: 787,
Visits: 1,192
|
|
-- xp_cmdshell is an advanced option, -- so first you need to check if it's turned on: EXEC sp_configure; GO
-- If you don't see xp_cmdshell in the list: EXEC sp_configure 'show advanced options', 1; RECONFIGURE; GO
-- Check the status of xp_cmdshell.
-- If necessary turn xp_cmdshell on: EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE; GO
-- Do stuff
-- If xp_cmdshell is no longer needed: EXEC sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO
-- If advanced options are no longer needed: EXEC sp_configure 'show advanced options', 0; RECONFIGURE; GO
Regards, Cath
"Hang on lads, I've got a great idea. " Michael Caine (Charlie Croker) The Italian Job
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 5:01 AM
Points: 42,
Visits: 121
|
|
|
|
|