{"id":361,"date":"2016-10-20T13:50:23","date_gmt":"2016-10-20T18:50:23","guid":{"rendered":"https:\/\/www.baronsoftware.com\/Blog\/?p=361"},"modified":"2016-10-20T13:50:23","modified_gmt":"2016-10-20T18:50:23","slug":"sql-stored-procedures-get-folder-files","status":"publish","type":"post","link":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/","title":{"rendered":"SQL Stored Procedures to get folder and files"},"content":{"rendered":"<p><a href=\"https:\/\/www.baronsoftware.com\">\u00a0<img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"7\" data-permalink=\"https:\/\/www.baronsoftware.com\/Blog\/delphi-create-a-process-or-shelling-to-start-up-an-external-application\/logo\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo-e1515620410626.jpg?fit=200%2C36&amp;ssl=1\" data-orig-size=\"200,36\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"logo\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo-e1515620410626.jpg?fit=200%2C36&amp;ssl=1\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg?resize=450%2C80&#038;ssl=1\" alt=\"Baron Software\" width=\"450\" height=\"80\" \/><\/a><\/p>\n<h3 style=\"text-align: center;\">SQL Stored Procedures to get folder and files<\/h3>\n<p>There may be a time when you will need to get the file name contents from a folder for the purpose of using the information in your stored procedure.\u00a0 The one undocumented stored procedure on Microsoft SQL Server 2016 is master.sys.xp_dirtree that you can use.<\/p>\n<p style=\"text-align: left;\">In your stored procedure, we will go ahead and create a temporary table that will store the files with their correct extension.\u00a0 The first thing we want to do is check whether the temporary table was left over and remove it.\u00a0 Usually when you close out a session temporary tables will be destroyed but it is fine to check and do house cleaning in\u00a0 your stored procedure.<\/p>\n<p style=\"text-align: left;\"><span style=\"color: #3366ff;\"><span style=\"font-family: Consolas; font-size: small;\">IF OBJECT_ID(&#8216;tempdb..#FilesListing&#8217;) IS NOT NULL<br \/>\nDROP TABLE #FilesListing;<\/span><\/span><\/p>\n<p>The next step is to create the temporary table again call it #FilesListing or whatever you wish to call it.\u00a0 This table will have an identity field which will be seeded with 1 and incremented by 1.\u00a0 The file name will be stored in FullFileName, you will see in a short period of time depth and isfile are used to store the information provided by the\u00a0undocumented extended stored procedure; master.sys.xp_dirtree.<\/p>\n<p style=\"text-align: left;\"><span style=\"color: #3366ff;\"><span style=\"font-family: Consolas; font-size: small;\">CREATE TABLE #FilesListing (<br \/>\nid int IDENTITY(1,1),<br \/>\nFullFileName nvarchar(512),<br \/>\ndepth int,<br \/>\nisfile bit);<\/span><\/span><\/p>\n<h3 style=\"text-align: center;\">Preparing master.sys.xp_dirtree<\/h3>\n<p>master.sys.xp_dirtree has three parameters:<\/p>\n<ol>\n<li>directory &#8211; This is the directory you pass when you call the stored procedure; like our example of C:\\TEMP.<\/li>\n<li>depth \u00a0&#8211; This tells the stored procedure how many subfolder levels to display.\u00a0 The default of 0 will display all subfolders.<\/li>\n<li>file &#8211; This will either display files as well as each folder.\u00a0 The default of 0 will not display any files.<\/li>\n<\/ol>\n<p><span style=\"color: #3366ff; font-family: Consolas; font-size: small;\">INSERT #FilesListing (FullFileName, depth, isfile )<br \/>\nEXEC master.sys.xp_dirtree &#8216;C:\\TEMP&#8217;, 1, 1;<\/span><\/p>\n<p>You can play with changing the depth and file settings from 0 to 1 to see the different results you can gather.\u00a0 Finally by placing a select statement from the temporary table #FilesListing will provide the results.<\/p>\n<p><span style=\"color: #3366ff; font-family: Consolas; font-size: small;\">Select * from #FilesListing;<\/span><\/p>\n<h3 style=\"text-align: center;\">Wrap\u00a0 up<\/h3>\n<p>Depth is 1 and file is 1 will\u00a0show only the directory names in the results<\/p>\n<p><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"362\" data-permalink=\"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/capture\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture.png?fit=282%2C254&amp;ssl=1\" data-orig-size=\"282,254\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"capture\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture.png?fit=282%2C254&amp;ssl=1\" class=\"size-full wp-image-362 aligncenter\" src=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture.png?resize=282%2C254&#038;ssl=1\" alt=\"capture\" width=\"282\" height=\"254\" \/><\/p>\n<p>Depth is 0 and file is 1 will show the directory and the file names in the results.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"363\" data-permalink=\"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/capture-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture-1.png?fit=344%2C174&amp;ssl=1\" data-orig-size=\"344,174\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"capture\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture-1.png?fit=344%2C174&amp;ssl=1\" class=\"size-full wp-image-363 aligncenter\" src=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture-1.png?resize=344%2C174&#038;ssl=1\" alt=\"capture\" width=\"344\" height=\"174\" srcset=\"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture-1.png?w=344&amp;ssl=1 344w, https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/Capture-1.png?resize=300%2C152&amp;ssl=1 300w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/p>\n<p>As you can see you can do a lot, one idea are nightly files deposited in a folder for the SQL Agent to kick off a stored procedure which needs to process them.\u00a0 The performance is quick but you need to be extremely careful where you are pulling files from since listing the entries into the table may take a few minutes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 SQL Stored Procedures to get folder and files There may be a time when you will need to get the file name contents from a folder for the purpose of using the information in your stored procedure.\u00a0 The one undocumented stored procedure on Microsoft SQL Server 2016 is master.sys.xp_dirtree that you can use. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":[],"rop_publish_now_history":[],"rop_publish_now_status":"pending","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-sql-tips"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Stored Procedures to get folder and files - Baron Software<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Stored Procedures listing files from a folder\" \/>\n<meta property=\"og:description\" content=\"There may be a time when you will need to get the file name contents from a folder for the purpose of using the information in your stored procedure.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Baron Software\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-20T18:50:23+00:00\" \/>\n<meta name=\"author\" content=\"richard@baronsoftware.com\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"SQL Stored Procedures listing files from a folder\" \/>\n<meta name=\"twitter:description\" content=\"There may be a time when you will need to get the file name contents from a folder for the purpose of using the information in your stored procedure.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@Rbaroniunas\" \/>\n<meta name=\"twitter:site\" content=\"@Rbaroniunas\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"richard@baronsoftware.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/\"},\"author\":{\"name\":\"richard@baronsoftware.com\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#\\\/schema\\\/person\\\/079d370e4230be9d5f75885bb33dd8cd\"},\"headline\":\"SQL Stored Procedures to get folder and files\",\"datePublished\":\"2016-10-20T18:50:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/\"},\"wordCount\":441,\"publisher\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/logo.jpg\",\"articleSection\":[\"SQL Tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/\",\"url\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/\",\"name\":\"SQL Stored Procedures to get folder and files - Baron Software\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/logo.jpg\",\"datePublished\":\"2016-10-20T18:50:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/logo.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/sql-stored-procedures-get-folder-files\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Stored Procedures to get folder and files\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#website\",\"url\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/\",\"name\":\"Baron Software\",\"description\":\"Highest Quality Software Developed.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#organization\",\"name\":\"Baron Software\",\"url\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i2.wp.com\\\/www.baronsoftware.com\\\/Blog\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/BaronSoftwareLogo.fw_.png?fit=1920%2C400&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i2.wp.com\\\/www.baronsoftware.com\\\/Blog\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/BaronSoftwareLogo.fw_.png?fit=1920%2C400&ssl=1\",\"width\":1920,\"height\":400,\"caption\":\"Baron Software\"},\"image\":{\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/Rbaroniunas\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.baronsoftware.com\\\/Blog\\\/#\\\/schema\\\/person\\\/079d370e4230be9d5f75885bb33dd8cd\",\"name\":\"richard@baronsoftware.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e5a3cc457a883c420e8af899f2639359d220ae6bfed4587ca7ed17f45ca0c21c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e5a3cc457a883c420e8af899f2639359d220ae6bfed4587ca7ed17f45ca0c21c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e5a3cc457a883c420e8af899f2639359d220ae6bfed4587ca7ed17f45ca0c21c?s=96&d=mm&r=g\",\"caption\":\"richard@baronsoftware.com\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Stored Procedures to get folder and files - Baron Software","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/","og_locale":"en_US","og_type":"article","og_title":"SQL Stored Procedures listing files from a folder","og_description":"There may be a time when you will need to get the file name contents from a folder for the purpose of using the information in your stored procedure.","og_url":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/","og_site_name":"Baron Software","article_published_time":"2016-10-20T18:50:23+00:00","author":"richard@baronsoftware.com","twitter_card":"summary_large_image","twitter_title":"SQL Stored Procedures listing files from a folder","twitter_description":"There may be a time when you will need to get the file name contents from a folder for the purpose of using the information in your stored procedure.","twitter_image":"https:\/\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg","twitter_creator":"@Rbaroniunas","twitter_site":"@Rbaroniunas","twitter_misc":{"Written by":"richard@baronsoftware.com","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#article","isPartOf":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/"},"author":{"name":"richard@baronsoftware.com","@id":"https:\/\/www.baronsoftware.com\/Blog\/#\/schema\/person\/079d370e4230be9d5f75885bb33dd8cd"},"headline":"SQL Stored Procedures to get folder and files","datePublished":"2016-10-20T18:50:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/"},"wordCount":441,"publisher":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/#organization"},"image":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#primaryimage"},"thumbnailUrl":"https:\/\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg","articleSection":["SQL Tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/","url":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/","name":"SQL Stored Procedures to get folder and files - Baron Software","isPartOf":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#primaryimage"},"image":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#primaryimage"},"thumbnailUrl":"https:\/\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg","datePublished":"2016-10-20T18:50:23+00:00","breadcrumb":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#primaryimage","url":"https:\/\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg","contentUrl":"https:\/\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.baronsoftware.com\/Blog\/sql-stored-procedures-get-folder-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.baronsoftware.com\/Blog\/"},{"@type":"ListItem","position":2,"name":"SQL Stored Procedures to get folder and files"}]},{"@type":"WebSite","@id":"https:\/\/www.baronsoftware.com\/Blog\/#website","url":"https:\/\/www.baronsoftware.com\/Blog\/","name":"Baron Software","description":"Highest Quality Software Developed.","publisher":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.baronsoftware.com\/Blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.baronsoftware.com\/Blog\/#organization","name":"Baron Software","url":"https:\/\/www.baronsoftware.com\/Blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.baronsoftware.com\/Blog\/#\/schema\/logo\/image\/","url":"https:\/\/i2.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2018\/01\/BaronSoftwareLogo.fw_.png?fit=1920%2C400&ssl=1","contentUrl":"https:\/\/i2.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2018\/01\/BaronSoftwareLogo.fw_.png?fit=1920%2C400&ssl=1","width":1920,"height":400,"caption":"Baron Software"},"image":{"@id":"https:\/\/www.baronsoftware.com\/Blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/Rbaroniunas"]},{"@type":"Person","@id":"https:\/\/www.baronsoftware.com\/Blog\/#\/schema\/person\/079d370e4230be9d5f75885bb33dd8cd","name":"richard@baronsoftware.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e5a3cc457a883c420e8af899f2639359d220ae6bfed4587ca7ed17f45ca0c21c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e5a3cc457a883c420e8af899f2639359d220ae6bfed4587ca7ed17f45ca0c21c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e5a3cc457a883c420e8af899f2639359d220ae6bfed4587ca7ed17f45ca0c21c?s=96&d=mm&r=g","caption":"richard@baronsoftware.com"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2e6qU-5P","jetpack-related-posts":[{"id":351,"url":"https:\/\/www.baronsoftware.com\/Blog\/getting-performance-statistics-cached-stored-procedures\/","url_meta":{"origin":361,"position":0},"title":"Getting performance statistics for cached stored procedures","author":"richard@baronsoftware.com","date":"October 18, 2016","format":false,"excerpt":"Getting performance statistics for cached stored procedures It is always extremely important to maintain your SQL server to the utmost efficiency.\u00a0\u00a0\u00a0 DBAs review the database structure and whether certain pieces such as stored procedures, triggers, etc. can be tuned even further.\u00a0 One of the areas that will be discussed are\u2026","rel":"","context":"In &quot;SQL Tips&quot;","block_context":{"text":"SQL Tips","link":"https:\/\/www.baronsoftware.com\/Blog\/category\/sql-tips\/"},"img":{"alt_text":"Baron Software","src":"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2014\/12\/logo.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":928,"url":"https:\/\/www.baronsoftware.com\/Blog\/microsoft-sql-server-how-to-get-a-table-size\/","url_meta":{"origin":361,"position":1},"title":"Microsoft SQL Server how to get a table size","author":"richard@baronsoftware.com","date":"July 22, 2018","format":false,"excerpt":"Microsoft SQL Server how to get a table size Sometimes you need to get the size of a particular table located in a database within the Microsoft Server and the following query can provide you that.\u00a0 You can run this manually or place it in a stored procedure for numerous\u2026","rel":"","context":"In &quot;SQL Tips&quot;","block_context":{"text":"SQL Tips","link":"https:\/\/www.baronsoftware.com\/Blog\/category\/sql-tips\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":289,"url":"https:\/\/www.baronsoftware.com\/Blog\/expedite-sql-development-rapid-sql\/","url_meta":{"origin":361,"position":2},"title":"Expedite SQL with Idera Rapid SQL 2016","author":"richard@baronsoftware.com","date":"June 9, 2016","format":false,"excerpt":"Expedite SQL Development with Rapid SQL 2016 \u2022 Write code across different database platforms - Produce high-performing SQL code across DBMS platforms (Oracle, SQL Server, DB2, Sybase and PostgreSQL) from one user interface. \u2022 Develop SQL code quickly and efficiently - The SQL IDE is a clean, slick development environment,\u2026","rel":"","context":"In &quot;SQL Tips&quot;","block_context":{"text":"SQL Tips","link":"https:\/\/www.baronsoftware.com\/Blog\/category\/sql-tips\/"},"img":{"alt_text":"Idera rapid sql 2016","src":"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/03\/Idera.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":610,"url":"https:\/\/www.baronsoftware.com\/Blog\/purge-microsoft-sql-email-items\/","url_meta":{"origin":361,"position":3},"title":"How to purge Microsoft SQL email Items","author":"richard@baronsoftware.com","date":"October 2, 2017","format":false,"excerpt":"How to purge Microsoft SQL email Items There are times that housecleaning older mail in your database needs to be done.\u00a0 A simple scheduled task can be done every month to purge what is no longer necessary.\u00a0 SQL Server stores all mails and attachments in\u00a0msdb\u00a0database. To avoid unnecessary growth of\u00a0msdb\u00a0database\u2026","rel":"","context":"In &quot;Computer PC Tips - bits and bytes&quot;","block_context":{"text":"Computer PC Tips - bits and bytes","link":"https:\/\/www.baronsoftware.com\/Blog\/category\/pc-tips-bits-bytes\/"},"img":{"alt_text":"Purge","src":"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/10\/microsofts-logo-gets-a-makeover-300x225.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":443,"url":"https:\/\/www.baronsoftware.com\/Blog\/creating-disaster-recovery-plan-database-sql\/","url_meta":{"origin":361,"position":4},"title":"Creating a Disaster Recovery Plan for your database (SQL)","author":"richard@baronsoftware.com","date":"February 15, 2017","format":false,"excerpt":"Creating a Disaster Recovery Plan for your database (SQL) \u00a0 Idera recently had a fantastic webinar that went over the creation of a disaster recovery plan concerning your databases. \u00a0This should be a high critical piece of work usually done by DBAs within a company. \u00a0Let's go over a simple\u2026","rel":"","context":"In &quot;Software development Concepts&quot;","block_context":{"text":"Software development Concepts","link":"https:\/\/www.baronsoftware.com\/Blog\/category\/software-development-concepts\/"},"img":{"alt_text":"Idera","src":"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/03\/Idera.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":201,"url":"https:\/\/www.baronsoftware.com\/Blog\/embarcadero-and-baron-software-powerstudio-case-study-which-monitors-sql-performance\/","url_meta":{"origin":361,"position":5},"title":"Embarcadero and Baron Software Powerstudio case study which monitors SQL Performance","author":"richard@baronsoftware.com","date":"January 7, 2016","format":false,"excerpt":"Embarcadero and Baron Software has issued a case study that demonstrates the benefits of using Microsoft SQL Powerstudio product line. \u00a0Powerstudio is a robust package that monitors SQL performance and can provide assistance for clients to update or create tables, stored procedures, etc. for various SQL servers some being Oracle,\u2026","rel":"","context":"In &quot;Rad Studio Delphi Development&quot;","block_context":{"text":"Rad Studio Delphi Development","link":"https:\/\/www.baronsoftware.com\/Blog\/category\/rad-studio-embarcadero-delphi-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/01\/Case-Study.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/01\/Case-Study.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.baronsoftware.com\/Blog\/wp-content\/uploads\/2016\/01\/Case-Study.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":1,"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/posts\/361\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baronsoftware.com\/Blog\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}