How to Execute an Operating System Command From Within SQL
Server ?

Answers were Sorted based on User's Feedback



How to Execute an Operating System Command From Within SQL Server ?..

Answer / sanjeev kumar

If your server is not configured for "xp_cmdshell" command
then at first you need to reconfigure for that. To
reconfigure, execute the following:-

sp_CONFIGURE 'xp_cmdshell', 1
GO
RECONFIGURE
GO

Then execute the following:-

EXEC master.dbo.xp_cmdshell 'Dir c:\'


Regards
Sanjeev kumar
Contact If your problem are still not solved.
thanks
skdeveloper0@gmail.com

Is This Answer Correct ?    4 Yes 0 No

How to Execute an Operating System Command From Within SQL Server ?..

Answer / guest

The xp_cmdshell extended store procedure makes it possible
to execute operating system commands from within SQL
Server.
Example:

EXEC Master..xp_cmdshell 'Dir c:\'

Is This Answer Correct ?    3 Yes 0 No

How to Execute an Operating System Command From Within SQL Server ?..

Answer / thatiparthi brahma reddy

EXEC Master.dbo.xp_cmdshell 'Dir d:\'

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are defaults? Is there a column to which a default can't be bound?

2 Answers   TCS,


What is the use of partition by in sql server?

0 Answers  


How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode?

3 Answers   HCL,


how you can list all the tables in a database?

0 Answers  


How to delete an existing database user?

0 Answers  






What is the purpose of object explorer and its features? : sql server management studio

0 Answers  


what is a self join? Explain it with an example? : Sql server database administration

0 Answers  


Tell me what are cursors and when they are useful?

0 Answers  


What value could be assigned to Varchar Type?

3 Answers  


can you any body tell me which service pack is installed in the sql server?

3 Answers  


Explain log shipping and mention its advantages.

0 Answers  


What are the differences between stored procedure and the dynamic sql?

0 Answers  


Categories