{"id":642,"date":"2024-12-18T15:41:20","date_gmt":"2024-12-18T15:41:20","guid":{"rendered":"https:\/\/datacrazyworld.com\/?p=642"},"modified":"2024-12-18T15:43:40","modified_gmt":"2024-12-18T15:43:40","slug":"los-no-documentados-sp_msforeachdb-y-sp_msforeachtable","status":"publish","type":"post","link":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/","title":{"rendered":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Existen dos procedimientos almacenados no documentados de SQL Server que te van a facilitar mucho la vida como DBA o DBD de SQL Server: <strong>sp_MSforeachdb <\/strong>y <strong>sp_MSforeachtable<\/strong>. \u00a1Vamos a conocerlos un poco mejor y a ver c\u00f3mo usarlos!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>sp_MSforeachdb<\/strong> es un SP que te va a permitir recorrer todas las bases de datos de la instancia ejecutando el comando que indiques.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>EXEC sp_MSforeachdb @command<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">El par\u00e1metro <em>@command<\/em> es un string donde indicar\u00e1s la sentencia T-SQL que quieres que se ejecute en cada una de las bases de datos. En caso de querer o necesitar referencia a la base de datos, tendr\u00e1s que utilizar <em>?<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Ejemplo<\/em>: Listar todas las tablas de cada una de las bases de datos de mi instancia. En este ejemplo, antes de listar las tablas, se indica la base de datos a la que se hace referencia<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DECLARE @sql varchar(1000) \nSELECT @sql = 'USE ? \n\nSELECT ''?'' as DB\nselect SCHEMA_NAME(schema_id) as Esquema, &#91;name] as tabla from sys.tables order by Esquema, tabla'\n\nEXEC sp_MSforeachdb @sql\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Visto este, podr\u00e9is intuir qu\u00e9 hace el otro SP que mencionabamos: <strong>sp_MSforeachtable<\/strong>. Este SP te va a permitir recorrer todas las tablas de una base de datos y aplicar la sentencia T-SQL que especifiques. Funciona igual que el anterior.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>EXEC sp_MSforeachtable @command<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>@command<\/em>: es la sentencia T-SQL que se aplicar\u00e1 por cada tabla<\/li>\n\n\n\n<li><em>?<\/em> : caracter a utilizar para referenciar a la tabla que corresponda<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Ejemplo<\/em>: Listar todas las tablas de una base de datos, indicando el n\u00famero de registros de cada una de ellas.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DECLARE @sql varchar(1000) \nSELECT @sql = 'SELECT ''?'' TableName, Count(1) NumRegistros FROM ?'\n\nEXEC sp_MSforeachtable @sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Ahora que ya os he presentado a estos dos secretos a voces, los podemos utilizar sin problemas en las siguientes entradas de blog. Como os he comentado antes, us\u00e1ndolos, vuestra tareas ser\u00e1n m\u00e1s sencillas. \u00bfLos conoc\u00edais?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>En esta T-SQL Pill  te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \u00a1Ven a conocerlos!<\/p>\n","protected":false},"author":2,"featured_media":316,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8,9],"tags":[21,12],"class_list":["post-642","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sqlserver","category-tsql","tag-sqlserver","tag-tsql"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"En esta T-SQL Pill te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \u00a1Ven a conocerlos!\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Cristina Tarabini-Castellani Ciordia\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@DataCrazyWorld\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World\" \/>\n\t\t<meta name=\"twitter:description\" content=\"En esta T-SQL Pill te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \u00a1Ven a conocerlos!\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@DataCrazyWorld\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/datacrazyworld.com\/wp-content\/uploads\/2022\/12\/Color_Small.png\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Cristina Tarabini-Castellani Ciordia\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura estimado\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#blogposting\",\"name\":\"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World\",\"headline\":\"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable.\",\"author\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/author\\\/tarabiquetevi\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/datacrazyworld.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/TSQLPill.png\",\"width\":1200,\"height\":630,\"caption\":\"T-SQL Pill\"},\"datePublished\":\"2024-12-18T15:41:20+00:00\",\"dateModified\":\"2024-12-18T15:43:40+00:00\",\"inLanguage\":\"es-ES\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#webpage\"},\"articleSection\":\"SQL Server, tsql, sqlserver, tsql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com#listItem\",\"position\":1,\"name\":\"Inicio\",\"item\":\"https:\\\/\\\/datacrazyworld.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/#listItem\",\"name\":\"SQL Server\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/#listItem\",\"position\":2,\"name\":\"SQL Server\",\"item\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/tsql\\\/#listItem\",\"name\":\"tsql\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com#listItem\",\"name\":\"Inicio\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/tsql\\\/#listItem\",\"position\":3,\"name\":\"tsql\",\"item\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/tsql\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#listItem\",\"name\":\"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable.\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/#listItem\",\"name\":\"SQL Server\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#listItem\",\"position\":4,\"name\":\"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable.\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/category\\\/sqlserver\\\/tsql\\\/#listItem\",\"name\":\"tsql\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/#person\",\"name\":\"Cristina Tarabini-Castellani Ciordia\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/020df7a271c91fd52178caf747ffe0997d2f1113e00f58e77a2878622e27453f?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Cristina Tarabini-Castellani Ciordia\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/DataCrazyWorld\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/cristina-tarabini-castellani\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/author\\\/tarabiquetevi\\\/#author\",\"url\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/author\\\/tarabiquetevi\\\/\",\"name\":\"Cristina Tarabini-Castellani Ciordia\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/020df7a271c91fd52178caf747ffe0997d2f1113e00f58e77a2878622e27453f?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Cristina Tarabini-Castellani Ciordia\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/DataCrazyWorld\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/cristina-tarabini-castellani\\\/\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#webpage\",\"url\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/\",\"name\":\"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World\",\"description\":\"En esta T-SQL Pill te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \\u00a1Ven a conocerlos!\",\"inLanguage\":\"es-ES\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/author\\\/tarabiquetevi\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/author\\\/tarabiquetevi\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/datacrazyworld.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/TSQLPill.png\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#mainImage\",\"width\":1200,\"height\":630,\"caption\":\"T-SQL Pill\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/index.php\\\/2024\\\/12\\\/18\\\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\\\/#mainImage\"},\"datePublished\":\"2024-12-18T15:41:20+00:00\",\"dateModified\":\"2024-12-18T15:43:40+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/#website\",\"url\":\"https:\\\/\\\/datacrazyworld.com\\\/\",\"name\":\"DataCrazyWorld\",\"description\":\"SQL Server, PowerShell, Power BI, Power Platform,... Los datos, ese mundo tan interesante, variado, divertido y ... \\u00a1Loco!\",\"inLanguage\":\"es-ES\",\"publisher\":{\"@id\":\"https:\\\/\\\/datacrazyworld.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World","description":"En esta T-SQL Pill te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \u00a1Ven a conocerlos!","canonical_url":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#blogposting","name":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World","headline":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable.","author":{"@id":"https:\/\/datacrazyworld.com\/index.php\/author\/tarabiquetevi\/#author"},"publisher":{"@id":"https:\/\/datacrazyworld.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/datacrazyworld.com\/wp-content\/uploads\/2023\/10\/TSQLPill.png","width":1200,"height":630,"caption":"T-SQL Pill"},"datePublished":"2024-12-18T15:41:20+00:00","dateModified":"2024-12-18T15:43:40+00:00","inLanguage":"es-ES","mainEntityOfPage":{"@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#webpage"},"isPartOf":{"@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#webpage"},"articleSection":"SQL Server, tsql, sqlserver, tsql"},{"@type":"BreadcrumbList","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com#listItem","position":1,"name":"Inicio","item":"https:\/\/datacrazyworld.com","nextItem":{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/#listItem","name":"SQL Server"}},{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/#listItem","position":2,"name":"SQL Server","item":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/","nextItem":{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/tsql\/#listItem","name":"tsql"},"previousItem":{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com#listItem","name":"Inicio"}},{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/tsql\/#listItem","position":3,"name":"tsql","item":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/tsql\/","nextItem":{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#listItem","name":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable."},"previousItem":{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/#listItem","name":"SQL Server"}},{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#listItem","position":4,"name":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable.","previousItem":{"@type":"ListItem","@id":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/tsql\/#listItem","name":"tsql"}}]},{"@type":"Person","@id":"https:\/\/datacrazyworld.com\/#person","name":"Cristina Tarabini-Castellani Ciordia","image":{"@type":"ImageObject","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/020df7a271c91fd52178caf747ffe0997d2f1113e00f58e77a2878622e27453f?s=96&d=mm&r=g","width":96,"height":96,"caption":"Cristina Tarabini-Castellani Ciordia"},"sameAs":["https:\/\/twitter.com\/DataCrazyWorld","https:\/\/www.linkedin.com\/in\/cristina-tarabini-castellani\/"]},{"@type":"Person","@id":"https:\/\/datacrazyworld.com\/index.php\/author\/tarabiquetevi\/#author","url":"https:\/\/datacrazyworld.com\/index.php\/author\/tarabiquetevi\/","name":"Cristina Tarabini-Castellani Ciordia","image":{"@type":"ImageObject","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/020df7a271c91fd52178caf747ffe0997d2f1113e00f58e77a2878622e27453f?s=96&d=mm&r=g","width":96,"height":96,"caption":"Cristina Tarabini-Castellani Ciordia"},"sameAs":["https:\/\/twitter.com\/DataCrazyWorld","https:\/\/www.linkedin.com\/in\/cristina-tarabini-castellani\/"]},{"@type":"WebPage","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#webpage","url":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/","name":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World","description":"En esta T-SQL Pill te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \u00a1Ven a conocerlos!","inLanguage":"es-ES","isPartOf":{"@id":"https:\/\/datacrazyworld.com\/#website"},"breadcrumb":{"@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#breadcrumblist"},"author":{"@id":"https:\/\/datacrazyworld.com\/index.php\/author\/tarabiquetevi\/#author"},"creator":{"@id":"https:\/\/datacrazyworld.com\/index.php\/author\/tarabiquetevi\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/datacrazyworld.com\/wp-content\/uploads\/2023\/10\/TSQLPill.png","@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#mainImage","width":1200,"height":630,"caption":"T-SQL Pill"},"primaryImageOfPage":{"@id":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/#mainImage"},"datePublished":"2024-12-18T15:41:20+00:00","dateModified":"2024-12-18T15:43:40+00:00"},{"@type":"WebSite","@id":"https:\/\/datacrazyworld.com\/#website","url":"https:\/\/datacrazyworld.com\/","name":"DataCrazyWorld","description":"SQL Server, PowerShell, Power BI, Power Platform,... Los datos, ese mundo tan interesante, variado, divertido y ... \u00a1Loco!","inLanguage":"es-ES","publisher":{"@id":"https:\/\/datacrazyworld.com\/#person"}}]},"twitter:card":"summary_large_image","twitter:site":"@DataCrazyWorld","twitter:title":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable. - Data Crazy World","twitter:description":"En esta T-SQL Pill te presento dos SP no documentados de microsoft que te van a facilitar mucho la vida: sp_MSforeachdb y sp_MSforeachtable. \u00a1Ven a conocerlos!","twitter:creator":"@DataCrazyWorld","twitter:image":"https:\/\/datacrazyworld.com\/wp-content\/uploads\/2022\/12\/Color_Small.png","twitter:label1":"Escrito por","twitter:data1":"Cristina Tarabini-Castellani Ciordia","twitter:label2":"Tiempo de lectura estimado","twitter:data2":"2 minutos"},"aioseo_meta_data":{"post_id":"642","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-12-18 15:34:31","updated":"2025-06-04 03:50:37","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/datacrazyworld.com\" title=\"Inicio\">Inicio<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/\" title=\"SQL Server\">SQL Server<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/tsql\/\" title=\"tsql\">tsql<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tLos no-documentados: sp_MSforeachdb y sp_MSforeachtable.\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Inicio","link":"https:\/\/datacrazyworld.com"},{"label":"SQL Server","link":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/"},{"label":"tsql","link":"https:\/\/datacrazyworld.com\/index.php\/category\/sqlserver\/tsql\/"},{"label":"Los no-documentados: sp_MSforeachdb y sp_MSforeachtable.","link":"https:\/\/datacrazyworld.com\/index.php\/2024\/12\/18\/los-no-documentados-sp_msforeachdb-y-sp_msforeachtable\/"}],"_links":{"self":[{"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/posts\/642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/comments?post=642"}],"version-history":[{"count":7,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/posts\/642\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/posts\/642\/revisions\/649"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/media\/316"}],"wp:attachment":[{"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/media?parent=642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/categories?post=642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datacrazyworld.com\/index.php\/wp-json\/wp\/v2\/tags?post=642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}