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

Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?

1 Answers  


What are the parts of a function?

1 Answers  


What is attribute relationships, why we need it? : sql server analysis services, ssas

1 Answers  


What are data files?

1 Answers  


How would you retrieve Unique rows from table without using UNIQUE and DISTINCT keyword?

2 Answers   Genpact,


Differences between Standby Vs No recovery?

2 Answers   Wipro,


There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?

1 Answers  


Explain the third normal form(3nf)?

1 Answers  


What happens if strings are casted into wrong code pages in ms sql server?

1 Answers  


What are the aggregate and scalar functions?

1 Answers  


How we can refresh the view?

1 Answers  


Explain error and transaction handling in sql server?

1 Answers  


Categories