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 is normalization of database? What are its benefits?

0 Answers  


You are designing a database for your human resources department in the employee table, there is a field for social security number, which cannot contain null values if no value is given, you want a value of unknown to be inserted in this field what is the best approach?

0 Answers  


What is the difference between indexing and hashing?

0 Answers  


How many types of cursor type are there?

0 Answers  


how can u get last observation in an unknown dataset ?

0 Answers   Genpact,


What are secondary xml indexes?

0 Answers  


Difference between sql server 2000 and sql server 2005?

11 Answers   Aditi Tech, eInfochips, GE, HCL, IBM, Masim Infotech, NIIT, Satyam, Systems Domain,


How to select some specific columns from a table in a query in ms sql server?

0 Answers  


What is a trigger and types of a trigger?

0 Answers  


How to replace the Query Result 'Null Value' with a text ?

0 Answers   MCN Solutions,


Explain about protocol layer present in SQL server?

0 Answers  


How much memory that we are using in Logshipping Concept?

0 Answers  


Categories