Home > Query, SQL > BISQL # 31 : How To Create Folder from SSMS

BISQL # 31 : How To Create Folder from SSMS

 

Hi Friends,

This is very normal requirement in DB,In most case SSIS developer requires this.

For this we have to use following two EXEC MASTER.dbo.Xp Sp’s

  • EXEC MASTER.sys.Xp_dirtree
  • EXEC MASTER.dbo.Xp_create_subdir

Lets go one by one

EXEC MASTER.sys.Xp_dirtree

This is used to find level of directories for a particular folder

— Below query will list out the directories on C drive in BIDS Folder

EXEC MASTER.sys.Xp_dirtree ‘C:\BIDS’

Having following output

image 

EXEC MASTER.dbo.Xp_create_subdir

This is used to create folder in any directory in windows OS

— Below query will create the folder SSIS Folder in BIDS Directory on C:\BIDS\ drive
EXEC MASTER.dbo.Xp_create_subdir ‘C:\BIDS\SSIS’

GO and try out the following query in your server

-- Below query will list out the directories on C:\BIDS drive
EXEC MASTER.sys.Xp_dirtree 'C:\BIDS'

-- Below query will create the folder SSIS in BIDS Directory  on C:\BIDS\ drive
EXEC MASTER.dbo.Xp_create_subdir 'C:\BIDS\SSIS'

-- Below query will create the folder VishalPawar folder in SSIS Directory   on C:\BIDS\SSIS drive
EXEC MASTER.dbo.Xp_create_subdir 'C:\BIDS\SSIS\VishalPawar'

 

You can also Visit to todays Link Resource Website : Link Resource # 8 July 28 « Dactylonomy of Web Resource

Hope this helps !!

For more interesting information on SQL we can also look into similar topics such as

· BISQL # 32 : How To find Parent Child Relationship Between Tables

· BISQL # 33 : Lets Understand Stored Procedure

· BISQL # 34 : What is Identity IN SQL {Identity Part–I}

· BISQL # 35 : Deep dive into Identity Functions in SQL {Identity Part–II}

· BISQL # 36 : Queries to Understand more on Identity aspect {Identity Part–III}

 

Hope you will like this post on Creating folder on SSMS.

If you really like reading my blog and understood at least few thing then please don’t forget to subscribe my blog.

If you want daily link and analysis or interesting link go to following website which will give @ your inbox please subscribe our following link resource blog : Link Resource Website

              For More information related to BI World visit my Mentalist Blog

                         Link Resource Blog >> Daily Interesting links

                         SQL Server Mentalist >> SQL Learning Blog

                         Business Intelligence Mentalist >> BI World

                                        Connect With me on

            | FaceBook |Twitter | LinkedIn| Google+ | WordPress | RSS |

                                   Copyright © 2011 – 2012 Vishal Pawar

Advertisement
Categories: Query, SQL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: