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 command is used to create a database in the sql server and how?

0 Answers  


Explain what is raid and what are different types of raid levels?

0 Answers  


Why we should not use triggers?

0 Answers  


What is the purpose of a table?

0 Answers  


Give me a SQL Query to find out the second largest company?

0 Answers   Ernst Young,






What is row_number()?

0 Answers  


Define synonym?

0 Answers  


Which databases are part of SQL server default installation? Explain the usage of each?

2 Answers   Accenture,


What is Files and Filegroups in SQL Server & it's implementation.

1 Answers   Zenith,


What are the different types of backups that exist?

0 Answers   ADITI,


Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration

0 Answers  


what stored procedure can you use to display the current processes? : Sql server administration

0 Answers  


Categories