{"id":22218,"date":"2025-06-05T03:26:51","date_gmt":"2025-06-05T03:26:51","guid":{"rendered":"http:\/\/www.withdata.com\/blog\/?p=22218"},"modified":"2026-07-15T04:59:46","modified_gmt":"2026-07-15T04:59:46","slug":"export-sql-server-table-to-xml-using-dynamic-filename-with-current-date","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/sqltotxt\/export-sql-server-table-to-xml-using-dynamic-filename-with-current-date.html","title":{"rendered":"Export SQL Server table to XML using dynamic filename with current date"},"content":{"rendered":"<p>Want to export data from  <a href=\"https:\/\/www.microsoft.com\/en-us\/cloud-platform\/sql-server\">SQL Server<\/a>  table to XML using current date as file name?<\/p>\n<p>Try Withdata <a href=\"https:\/\/www.withdata.com\/db-to-file\/\">DBToFile<\/a>, a SQL Server to XML converter for Windows, Linux, and macOS, Export SQL Server data to XML, Easy and Fast. <\/p>\n<ul>\n<li>Can run in <span id=\"gui\">GUI<\/span> mode, <a href=\"#convert\">Step by Step<\/a>, just a few mouse clicks.<\/li>\n<li>Can run in <a href=\"\/tools\/db-to-file\/mssql-to-xml-cmd\" target=\"_blank\">Command line<\/a>, for <a href=\"\/tools\/db-to-file\/mssql-to-xml-task\" target=\"_blank\">Scheduled Tasks<\/a> and Streams.<\/li>\n<li>Support <a href=\"\/tools\/db-to-file\/mssql-to-xml-windows\" target=\"_blank\">Windows<\/a>, <a href=\"\/tools\/db-to-file\/mssql-to-xml-linux\" target=\"_blank\">Linux<\/a>, and <a href=\"\/tools\/db-to-file\/mssql-to-xml-macos\" target=\"_blank\">macOS<\/a>.<\/li>\n<\/ul>\n<p><a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\">Download Withdata DBToFile<\/a>  <a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/download_3.jpg\" alt=\"Download DBToFile\" width=\"80\" height=\"22\" style=\"max-width:100%;height:auto;\" \/><\/a> <span id=\"dtv\" style=\"display: none;\"><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=win64\">Windows 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=win32\">Windows 32 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=deb\">Linux .deb (For Debian, Ubuntu) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=rpm\">Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=pkg\">MacOS 64 bit<\/a><br \/>\n<\/span><\/p>\n<h2 id=\"export\">Export data from SQL Server table to XML file using dynamic filename with date and time<\/h2>\n<p><a href=\"#login\">Login to SQL Server<\/a> -> <a href=\"#source\">Choose SQL Server table<\/a> -> <a href=\"#target\">Set XML filename template including date<\/a> -> <a href=\"#do\">Export SQL Server to XML using current date as file name <\/a><\/p>\n<p id=\"login\"> Choose SQL Server and logon.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/logon\/choose_sql-server_logon.png\" alt=\"export SQL Server table to XML file - Choose SQL Server and logon\" width=\"430\" height=\"442\" style=\"max-width:100%;height:auto;display:block;\" \/><\/p>\n<p> &#8220;Export From Table&#8221; for &#8220;<a href=\"https:\/\/www.google.com\/search?q=site:withdata.com+XML to SQL Server\">XML to SQL Server<\/a>&#8220;.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/wizard-task.png\" ALT=\"Export data from SQL Server Table To XML using variable filename with date - task window\" width=\"636\" height=\"457\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<p>Select <a href=\"https:\/\/www.google.com\/search?q=site:withdata.com+XML\">XML<\/a> file type.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/select-xml-type.png\" ALT=\"Export data from SQL Server Table To XML using variable filename with date - select XML file type\" width=\"489\" height=\"200\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<h3 id=\"source\">1. Choose SQL Server table.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/table-to-a-file-source.png\" ALT=\"Unload data from SQL Server Table To XML using dynamic filename with date - select table\" width=\"722\" height=\"572\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<h3 id=\"target\">2. Set XML file options. Enter filename template, including date,  #yyyy# is for current year, #mm# month, #dd# day, #hh# hour, #mi# minute, #ss# second.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/table-to-xml-target-dynamic.png\" ALT=\"Extract data from SQL Server Table To XML using dynamic filename with date - enter file name\" width=\"722\" height=\"572\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<h3>3. Set rows options.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/table-to-xml-summary-dynamic.png\" ALT=\"Convert data from SQL Server Table To XML using dynamic filename with date - summary\" width=\"722\" height=\"572\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<h3 id=\"do\">4. <a href=\"https:\/\/www.google.com\/search?q=site:withdata.com+Export SQL Server\">Export SQL Server<\/a> table data to XML file. Dynamically created XML file name using present system time.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/table-to-xml-convert-dynamic.png\" ALT=\"Dump data from SQL Server Table To XML using dynamic filename with date - export\" width=\"722\" height=\"572\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<p>After exporting, you can view output <a href=\"https:\/\/www.google.com\/search?q=site:withdata.com+XML\">XML<\/a> files.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/dbtofile\/wizard_view_xml-dynamic.png\" alt=\"Export data from SQL Server Table To XML using template filename with date - view XML file\" width=\"722\" height=\"572\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<hr style=\"clear: both;\" \/>\n<p>More about <a href=\"\/tools\/db-to-file\/mssql-to-xml\">SQL Server to XML converter<\/a><\/p>\n<div id=\"download-bottom\" style=\"clear: both;\">\n<p>Download Withdata DBToFile<a href=\"#download-bottom\" onclick=\"dbv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/btn_download_green.png\" alt=\"Download DBToFile\" width=\"165\" height=\"50\" style=\"max-width:100%;height:auto;\" loading=\"lazy\" decoding=\"async\" \/><\/a> <span id=\"dbv\" style=\"display: none;\"><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=win64\">Windows 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=win32\">Windows 32 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=deb\">Linux .deb (For Debian, Ubuntu) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=rpm\">Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=DBToFile&#038;ver=pkg\">MacOS 64 bit<\/a><br \/>\n<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Want to export data from SQL Server table to XML using current date as file name? Try Withdata DBToFile, a SQL Server to XML converter for Windows, Linux, and macOS, Export SQL Server data to XML, Easy and Fast. Can run in GUI mode, Step by Step, just a few mouse clicks. Can run in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[65],"tags":[13299,1321,68],"class_list":["post-22218","post","type-post","status-publish","format-standard","hentry","category-sqltotxt","tag-dynamic-export","tag-sql-server","tag-xml"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/22218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/comments?post=22218"}],"version-history":[{"count":4,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/22218\/revisions"}],"predecessor-version":[{"id":41990,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/22218\/revisions\/41990"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=22218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=22218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=22218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}