.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> SQL Query >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

How to Create Folder from SQL Server Query

Posted By:Sajid P K       Posted Date: October 12, 2010    Points: 15    Category: SQL Query    URL: http://www.dotnetspark.com  

This Article explains creating folder using TSQL. 1) Using sys.xp_create_subdir Extended Stored Procedure 2) Using xp_cmdshell


1. sys.xp_create_subdir Extended Stored Procedure


 master.sys.xp_create_subdir 'C:\Test\'   

2. Using xp_cmdshell


declare @MD varchar(100), @Path varchar(100)

SET @Path = 'C:\test\'
SET @MD = ' mkdir ' + @Path 

EXEC xp_cmdshell @MD



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend