{"id":1315,"date":"2012-12-18T21:44:25","date_gmt":"2012-12-18T21:44:25","guid":{"rendered":"http:\/\/www.stuartroberts.net\/?p=1315"},"modified":"2012-12-18T21:44:25","modified_gmt":"2012-12-18T21:44:25","slug":"quick-tip-15","status":"publish","type":"post","link":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/","title":{"rendered":"Get Default Database Infomation"},"content":{"rendered":"<p><strong>SharePoint Short #15<\/strong><\/p>\n<p>Looking for a quick an easy way of retrieving the default content database information, like the SQL instance (i.e. servername\\instance)?<\/p>\n<pre lang=\"csharp\">\r\nstring sqlServerInstance = SPWebService.ContentService.DefaultDatabaseInstance.NormalizedDataSource;\r\n<\/pre>\n<p>or individually<\/p>\n<pre lang=\"csharp\">\r\nstring sqlInstance = SPWebService.ContentService.DefaultDatabaseInstance.Instance;\r\nstring sqlServer = SPWebService.ContentService.DefaultDatabaseInstance.Server;\r\n<\/pre>\n<p>The <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.sharepoint.administration.spwebservice(v=office.12).aspx\" title=\"SPWebService Class\" target=\"_blank\">SPWebService<\/a> class provides an easy and quick way of retrieving this, along with the administration database specific properties.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SharePoint Short #15 Looking for a quick an easy way of retrieving the default content database information, like the SQL instance (i.e. servername\\instance)? string sqlServerInstance = SPWebService.ContentService.DefaultDatabaseInstance.NormalizedDataSource; or individually string sqlInstance = SPWebService.ContentService.DefaultDatabaseInstance.Instance; string sqlServer = SPWebService.ContentService.DefaultDatabaseInstance.Server; The SPWebService class &hellip; <a href=\"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[44],"tags":[45],"class_list":["post-1315","post","type-post","status-publish","format-standard","hentry","category-shorts","tag-sharepoint-short"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"How to retrieve information about the default content database in SharePoint\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Stu\"\/>\n\t<meta name=\"keywords\" content=\"sharepoint,sps,sp,tip,tips,quick tip,quick tips,database,default database,database information,shorts\" \/>\n\t<link rel=\"canonical\" href=\"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_GB\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Stuart Roberts on all things SharePoint |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint\" \/>\n\t\t<meta property=\"og:description\" content=\"How to retrieve information about the default content database in SharePoint\" \/>\n\t\t<meta property=\"og:url\" content=\"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2012-12-18T21:44:25+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2012-12-18T21:44:25+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@SharePointStu\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint\" \/>\n\t\t<meta name=\"twitter:description\" content=\"How to retrieve information about the default content database in SharePoint\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@SharePointStu\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#article\",\"name\":\"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint\",\"headline\":\"Get Default Database Infomation\",\"author\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"Stu\"},\"datePublished\":\"2012-12-18T21:44:25+00:00\",\"dateModified\":\"2012-12-18T21:44:25+00:00\",\"inLanguage\":\"en-GB\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#webpage\"},\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#webpage\"},\"articleSection\":\"Shorts, SharePoint Short\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.stuartroberts.net\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/shorts\\\/#listItem\",\"name\":\"Shorts\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/shorts\\\/#listItem\",\"position\":2,\"name\":\"Shorts\",\"item\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/shorts\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#listItem\",\"name\":\"Get Default Database Infomation\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#listItem\",\"position\":3,\"name\":\"Get Default Database Infomation\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/shorts\\\/#listItem\",\"name\":\"Shorts\"}}]},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#person\",\"name\":\"Stu\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"Stu\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"Stu\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"Stu\"}},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#webpage\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/\",\"name\":\"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint\",\"description\":\"How to retrieve information about the default content database in SharePoint\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#website\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2012\\\/12\\\/18\\\/quick-tip-15\\\/#breadcrumblist\"},\"author\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2012-12-18T21:44:25+00:00\",\"dateModified\":\"2012-12-18T21:44:25+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#website\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/\",\"name\":\"Stuart Roberts on all things SharePoint\",\"inLanguage\":\"en-GB\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint","description":"How to retrieve information about the default content database in SharePoint","canonical_url":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/","robots":"max-image-preview:large","keywords":"sharepoint,sps,sp,tip,tips,quick tip,quick tips,database,default database,database information,shorts","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#article","name":"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint","headline":"Get Default Database Infomation","author":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author"},"publisher":{"@id":"http:\/\/www.stuartroberts.net\/#person"},"image":{"@type":"ImageObject","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g","width":96,"height":96,"caption":"Stu"},"datePublished":"2012-12-18T21:44:25+00:00","dateModified":"2012-12-18T21:44:25+00:00","inLanguage":"en-GB","mainEntityOfPage":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#webpage"},"isPartOf":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#webpage"},"articleSection":"Shorts, SharePoint Short"},{"@type":"BreadcrumbList","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/#listItem","position":1,"name":"Home","item":"http:\/\/www.stuartroberts.net\/","nextItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/shorts\/#listItem","name":"Shorts"}},{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/shorts\/#listItem","position":2,"name":"Shorts","item":"http:\/\/www.stuartroberts.net\/index.php\/category\/shorts\/","nextItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#listItem","name":"Get Default Database Infomation"},"previousItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#listItem","position":3,"name":"Get Default Database Infomation","previousItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/shorts\/#listItem","name":"Shorts"}}]},{"@type":"Person","@id":"http:\/\/www.stuartroberts.net\/#person","name":"Stu","image":{"@type":"ImageObject","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g","width":96,"height":96,"caption":"Stu"}},{"@type":"Person","@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author","url":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/","name":"Stu","image":{"@type":"ImageObject","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g","width":96,"height":96,"caption":"Stu"}},{"@type":"WebPage","@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#webpage","url":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/","name":"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint","description":"How to retrieve information about the default content database in SharePoint","inLanguage":"en-GB","isPartOf":{"@id":"http:\/\/www.stuartroberts.net\/#website"},"breadcrumb":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/#breadcrumblist"},"author":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author"},"creator":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author"},"datePublished":"2012-12-18T21:44:25+00:00","dateModified":"2012-12-18T21:44:25+00:00"},{"@type":"WebSite","@id":"http:\/\/www.stuartroberts.net\/#website","url":"http:\/\/www.stuartroberts.net\/","name":"Stuart Roberts on all things SharePoint","inLanguage":"en-GB","publisher":{"@id":"http:\/\/www.stuartroberts.net\/#person"}}]},"og:locale":"en_GB","og:site_name":"Stuart Roberts on all things SharePoint |","og:type":"article","og:title":"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint","og:description":"How to retrieve information about the default content database in SharePoint","og:url":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/","article:published_time":"2012-12-18T21:44:25+00:00","article:modified_time":"2012-12-18T21:44:25+00:00","twitter:card":"summary","twitter:site":"@SharePointStu","twitter:title":"Quick Tip #15 - Get Default Database Infomation | Stuart Roberts on all things SharePoint","twitter:description":"How to retrieve information about the default content database in SharePoint","twitter:creator":"@SharePointStu"},"aioseo_meta_data":{"post_id":"1315","title":"Quick Tip #15 - Get Default Database Infomation | #site_title","description":"How to retrieve information about the default content database in SharePoint","keywords":[{"label":"SharePoint","value":"SharePoint"},{"label":"SPS","value":"SPS"},{"label":"SP","value":"SP"},{"label":"tip","value":"tip"},{"label":"tips","value":"tips"},{"label":"quick tip","value":"quick tip"},{"label":"quick tips","value":"quick tips"},{"label":"database","value":"database"},{"label":"default database","value":"default database"},{"label":"database information","value":"database information"}],"keyphrases":{"focus":[],"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":null,"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":"","isEnabled":true},"graphs":[]},"schema_type":null,"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":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-08-03 13:49:30","updated":"2026-10-16 15:53:00","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.stuartroberts.net\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.stuartroberts.net\/index.php\/category\/shorts\/\" title=\"Shorts\">Shorts<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGet Default Database Infomation\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"http:\/\/www.stuartroberts.net\/"},{"label":"Shorts","link":"http:\/\/www.stuartroberts.net\/index.php\/category\/shorts\/"},{"label":"Get Default Database Infomation","link":"http:\/\/www.stuartroberts.net\/index.php\/2012\/12\/18\/quick-tip-15\/"}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/comments?post=1315"}],"version-history":[{"count":2,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1315\/revisions"}],"predecessor-version":[{"id":1317,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1315\/revisions\/1317"}],"wp:attachment":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/media?parent=1315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/categories?post=1315"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/tags?post=1315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}