List extended properties on all databases

I need a script that lists/returns all extended properties in all the databases on a SQL Server 2008 Instance.
For example the script below returns the extended property for a single database.
SELECT objtype, objname, name, value
FROM fn_listextendedproperty(default, default, default, default, default, default, default);
However I need a script that returns the extended properties for all databases. Thanks.

Hi,
Try PowerShell like below to get the information:
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
$s = New-Object ('Microsoft.SqlServer.Management.Smo.Server') "computer\instance"
$dbs = $s.Databases
foreach ($db in $dbs)
$ds=$db.ExecuteWithResults("SELECT objtype, objname, name, value FROM fn_listextendedproperty(default, default, default, default, default, default, default)")
$table = $ds.Tables[0];
foreach ($row in $table)
Write-Host $row.Item("objtype") $row.Item("objname")$row.Item("name")$row.Item("value");
Please check below articles for more information:
http://www.mssqltips.com/sqlservertip/1759/retrieve-a-list-of-sql-server-databases-and-their-properties-using-powershell/
http://social.technet.microsoft.com/Forums/windowsserver/en-US/ff5ae2d3-0923-4240-a532-2d879d9528a6/using-powershell-to-get-data-from-sql-database?forum=winserverpowershell
Hope it helps.
Tracy Cai
TechNet Community Support

Similar Messages

  • How to fetch Properties of all Survey Lists from site collection using Java Script in SharePoint 2013

    Hi,
    I am trying to fetch properties of all lists of "Survey Type" from my site collection in SharePoint 2013 using script editor web part. I am able to fetch properties of one list by mentioning its name explicitly in code but not all survey
    list.
    My task is to display Survey name , description ,Time created and URLs of all survey lists using java script in script editor web part.
    And let me know , if there is any other OOB feature of SharePoint 2013 to achieve the same. 
    Here is the code  :
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
    function sharePointReady() {
         GetSurveyList();
     function GetSurveyList() {
            var spListTitle = " List Name";
             var clientContext = new SP.ClientContext.get_current();
            var oWeb = clientContext.get_web();
            this.surveyList = oWeb.get_lists().getByTitle(spListTitle);
            clientContext.load(surveyList);
            clientContext.executeQueryAsync(Function.createDelegate(this, this.GetListProperties),Function.createDelegate(this, this.onFailure));
     function GetListProperties() {
            $("#SurveyList").text("");
            var surveyTable = "<table border=1>";
            surveyTable = surveyTable.concat("<tr><td>Survey Name</td>");
            surveyTable = surveyTable.concat("<td>Survey Description</td>");
            surveyTable = surveyTable.concat("<td>Time Created</td>");
            surveyTable = surveyTable.concat("<tr><td>" + surveyList.get_title() + "</td>");
            surveyTable = surveyTable.concat("<td>" + surveyList.get_description() + "</td>");
            surveyTable = surveyTable.concat("<td>" + surveyList.get_created().format("MM/dd/yyyy hh:mm tt")+ "</td>");
                 surveyTable = surveyTable.concat("</table>");
            $("#SurveyList").append(surveyTable);
        function onFailure(sender, args) {
            alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    <div id="SurveyList"></div>

    Shifa,
    Please use search result webpart or content query webpart to list all survey list.
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Data warehouse ETL - dropping all FK but what about extended properties? Do they need to be re-added

    So Im setting up a SSIS package to refill the DB, drop/re-add the keys etc and I notice that there are extended properties added in the definition of the keys added to the fact table.  Do these needed to be added back EXACTLY as they are defined (when
    viewing them in management studio via right-click > script key) ?
    Im thinking they do as they mention the DSV, so Im guessing that not adding them back might mess up the DSV?

    Lightning is a problem for you because it hooks into Thunderbird at a low level and you need a version compiled for the platform Thunderbird is running on. So you can't do the preferred solution, which is to put your whole profile in a shared folder and have both instances of Thunderbird reference the same profile. (Ditto for Enigmail). Lightning may become an integral part of Thunderbird in an upcoming release, at which point this limitation due to Lightning should disappear.
    And if you can't use a shared profile, you can't set your Lightning, or your Address Book, to share a common set of files. Put another way, the linkage from Thunderbird to its address book files and calendar data is hard-coded, and not exposed where we can adjust it. :-(
    The halfway house is to place your mail stores in a shared place, and use the Local Directory setting in each account's settings to connect to it. They don't need to be in the profile; what's more important in your case is that they are in a folder accessible to both operating systems.
    Look in your profile; everything under Mail and ImapMail needs to be moved out to a shared folder. Note the entries in Thunderbird under Local Directory before you do this, and reconstruct those pathnames in Thunderbird, but adjusted to suit their new locations.
    (You can see here that you need to make many adjustments, one per account, in each instance of Thunderbird, so it's a high-maintenance solution and this is why we don't recommend it when the alternative, moving the whole profile, is possible.)
    I share address books and calendars between Thunderbirds on various computers (and my phone and tablet) by syncing to something in the cloud; Google Contacts and Google Calendar are my choices, using gContactSync and CalDav.
    Having made the break myself some years ago, I'd recommend you break away from Windows. ;-)

  • How to extend ECC6 tablespace? database is MSSQL

    Hello all,
    I intall ECC6 IDES, now I want to extend tablespace, but I didn't found command about brtools and sapdba, because my database is not oracle . how to do it? thank you.
    OS: WIndows 2003
    SAP release: ECC 6
    database: Microsoft MSSQL 2005

    (SQL Server Management Studio)
    SQL Server 2005
    SQL Server 2008 R2
    SQL Server 2008
    SQL Server 2012
    This topic describes how to increase the size of a database by using Object Explorer in SQL Server Management Studio. The database is expanded by either increasing the size of an existing data or log file or by adding a new file to the database.
    To increase the size of a database
    In Object Explorer, connect to an instance of the SQL Server 2005 Database Engine, and then expand that instance.
    Expand Databases, right-click the database to increase, and then click Properties.
    In Database Properties, select the Files page.
    To increase the size of an existing file, increase the value in the Initial Size (MB) column for the file. You must increase the size of the database by at least 1 megabyte.
    To increase the size of the database by adding a new file, click Add and then enter the values for the new file
    Click OK.
     

  • Is it possible to delete extended properties without knowing the id?

    Hello,
    Can you delete any custom extended properties without knowing their ID?
    I took over managing a feature that used EWS to send emails to customers.The current code creates a new GUID, and thus new Extended Property, every time an email is sent.
    // Create a custom extended property and add it to the message.
    var myExtendedPropertyDefinition = new ExtendedPropertyDefinition(Guid.NewGuid(), "MyGuidId", MapiPropertyType.String);
    mail.SetExtendedProperty(myExtendedPropertyDefinition, "MyGuidId");
    // Send and save a copy
    mail.SendAndSaveCopy();
    Is there a way to delete any of the custom extended propeties without knowing the IDs?
    Thank you

    No you can't do that in EWS you need to know the details of the property you want to Read/Write or delete. EWS has no method of enumerating all extended properties either you would need to use MAPI to do this.
    >>The current code creates a new GUID, and thus new Extended Property, every time an email is sent.
     I'd question the design of this what where they trying to acheive ? Why not have ths same property with a different Value ? else using an X-header would be better idea at least then it will persist ouside of your Exchange infrastructure and even
    inside would be more discoverable.
    Cheers
    Glen

  • SQL Server wants to open properties of wrong database and cannot restore logs of different databases at the same time

    We have implemented our own way of logshipping by backing up the transaction logs of all our non-system databases every hour. Then we transfer the backups (before SQL Server 2008 R2 with additional zip and unzip steps) to the second environment where we
    restore them only during the night on databases in standby-state (Like this, our developers can access the databases without disturbing the productive system and we can restore the t-logs during night, so not shutting out the developers during the day).
    Now since we replaced our hardware in the productive environment, we replaced the hardware in the second environment with the servers from previous productive environment. Same SQL Server 2008 R2, same Service Pack (SP2), same installation procedure. But
    since then the SQL Server in the second environment behaves different:
    - When the logs of some database "A" are restored, I cannot access the properties of any database, i.e. database "B", I only get the error message "Cannot show requested dialog. (SqlMgmt) Database 'A' cannot be opened. It is in the
    middle of a restore. (Microsoft SQL Server, Error: 927)"
    - Our logshipping runs multiple instance at the same time, so restoring multiple databases' logs. But since the change, two of the instances fail restoring of datatbases, i.e. "B" and "C" with the error message "Database 'A' cannot
    be opened. It is in the middle of a restore.". The jobs guarantee to restore only logs of the database they need to restore, they have strictly separated sets of target databases and only try to restore the databases of their sets.
    Before the new installations, we did not have these strange behaviours. But as said, it is the same SQL Server version, the same service pack, and we followed the same installation document but maybe with the small changes in settings. The user the jobs
    are running under is a domain admin, the login they use has dbcreator, processadmin, db_owner and db_backupoperator roles. My login on the SQL Server has sysadmin rights and as described similar problems.
    Is this problem known or does somebody have an idea where to go looking for?
    Thanks, Chris

    Hi Christar,
    According to your description, after you configuring Log shipping between two database, you remove the hardware from production environment to dev environment, in this hardware, there are saved the transaction logs of your database.
     When restoring  your database, there will occurs error 927, right?
    SQL Server Log shipping allows you to automatically send transaction log backups from a
    primary database on a primary server instance to one or more
    secondary databases on separate secondary server instances. It consists of three operations:
    1.Back up the transaction log at the primary server instance.
    2.Copy the transaction log file to the secondary server instance.
    3.Restore the log backup on the secondary server instance.
    Since you want to move your hardware avoiding copy job, we need to verify if .mdf and .ldf file are not saved in your hardware, or else,
     if you move your hardware, you could not open your database in your Primary Server. I recommend you can refer to the following steps.
    Full back up your primary database and restore it into the secondary database. It would have been set up as WITH STANDBY ,the databases would read StandBy/ Read Only.
    Perform transaction log backups via a SQL Server Agent job running on the primary server instance, save them in your hardware.
    In night, you move hardware to your dev environment, you can manually restore these transaction log backups or set up a SQL Server Agent job to restoring them from your hardware.
    There is detail about how to configure log shipping in SQL Server 2008R2 step by step, you can review it.
    http://mostafaelmasry.wordpress.com/2013/01/02/log-shipping-in-sql-server-2008r2-step-by-step/
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Cannot see all database users in RAU

    Hi,
    I logged in as repos_owner and tried to maintain users. When I get the window for the new repositoy user properties I see nearly all users but 1 not.
    Is there a filter or so or does this user need some grants. The user exists and I can connect to the database.
    Please help me.
    Regards
    siegwin

    I found the solution in Metalink
    Can Not See All Database Users in RAU, Maintain Users in Oracle Designer [ID 1086028.6]
    Thanks

  • Parameters - Not Filling in when using Append all database values

    Hello, I am using CR 2013 and trying to create a parameter which would be a list of organization names from a MySQL Database.  I am able to see the tables and field names no problem but when I click Append all database values I get the circle and nothing appears.   It should be noted I can see a list of values in the "Select Expert" for that same table and field.
    I am running a Windows 7 machine.
    Please let me know if you have any suggestions or solutions.
    Thanks,
    Peter LaMont

    are you using win 7 sp1 or higher as per the supported platforms. you probably are but have to ask.
    i would recommend trying to create a new report off of the same db and try to use a dcp again. if that doesn't work, can you create a dcp (using a new report) off of a different database type...e.g. ms access?
    is anyone else in your environment having the same issue?
    if none of the above work it's most likely an install issue and you may wish to try an update of cr finding the latest sp here..

  • Unable to programmatically get content of extended properties in custom control

    Hi all
    I am facing some problems with a custom control which I applied to the Business Service class form. The goal of this control is to automatically populate the DisplayName property of a Business Service based on two properties which are part of a Business
    Service class extension. The control is working fine and gets applied successfully to the Business Service forms.
    Also populating DisplayName as well as other OOB Business Service properties works fine, but when it comes to extended properties, it seems as if the instance I am working with in the custom control is not aware of those... However when getting the class
    of the given instance and searching propertyCollection, both properties are visible.
    It seems so me as if the instance I am working with is just no aware of properties coming from a class extension. I never ran into that when building my own custom forms.
    Any thoughts about this?
    private void ServicePriceListView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
    //Check if we get an IDataItem
    if (this.DataContext is IDataItem)
    //Get the IDataItem
    inst = (IDataItem)this.DataContext;
    IDataItem dataItemClass = inst["$Class$"] as IDataItem;
    Dictionary<string, IDataItem> dataItemClassProperties = dataItemClass["PropertyCollection"] as Dictionary<string, IDataItem>;
    // dataItemClassProperties contains both extended properties
    string displayName = inst["DisplayName"].ToString(); // Works fine
    string serviceID = inst["scsmlabid"].ToString(); // Does not find property scsmlabid
    string serviceDescription = inst["scsmlabdescription"].ToString(); // Does not find property scsmlabdescription
    //Set DisplayName
    inst["DisplayName"] = inst["mchserviceid"] + " - " + inst["mchdescription"];
    Blog: http://scsmlab.com  Twitter:
    @scsmlab

    The "FormView" object is, for all intents and purposes, your parent form object. You can use FormUtilities.GetFormView() and send pretty much any control from your form as a parameter to that method. It'll send back the top-level FormView object.
    (More precisely, the FormView's "Form" property is your parent form object..ie: FormView MyMainForm = FormUtilities.GetFormView(this); MyMainForm.Form;)
    With that object you can subscribe to all of the typical FrameworkElement events. If you want to subscribe to the SCSM Console API events, use the FormEvents class and add a handler to MyMainForm.Form using .AddHandler() and .RemoveHandler(). 
    Here's a little primer from Microsoft on the Console form events:
    https://technet.microsoft.com/en-us/library/ff461071.aspx

  • Combo/List Box Item List in Properties

    Im creating a form in Acrobat.  Used a list box instead of combo box.  But need to change to combo box.  I already entered in all the items for the list.  I don't want to spend too much time on this.  Is there a way to copy the list from properties on the list box and past into the new combo box?

    You can use Acrobat JavaScript to convert the current items, getItemAt,
    in the list box/combo box to an array or list that could be edited in array definition, edit that list and then use JavaScript, setItems, to use that array to populate the field.

  • Service Objects Extended Properties

    Hi,
    I'm looking for a list of registered keywords and properties
    for the Service Objects extended properties.
    I found servicetobind and forte_generated, but I'm looking
    for the exhaustive set, so that not to interfere with them.
    Thanks for any input,
    j-paul gabrielli
    sema dts

    Hi Denis,
    it worked now. i had didn't stop SIA completely.
    Thanks!!!
    -Pavana

  • List of Dimensions of a Database

    Hi,I am wondering how I can list all the dimensions of a database with Essbase API?Thanks,Winnie

    I'm also working on getting a list of members from a database.... Have you had any luck... ? I'll post what I have and maybe someone can give us some pointers that will solve both your issue and mine..... Thanks to anyone who offers comments.....The following returns sts = 0 but doesn't give me actual names...... and I haven't figured out how to get them yet..... I'm sure it's simple I just haven't found it yet....Public Sub ProcessSelections()Dim sts As LongDim x As VariantDim Init As ESB_INIT_TDim object As ESB_OBJDEF_TDim sGroupName As String * ESB_USERNAMELENDim LevelName As String * ESB_MBRNAMELENDim houtline As LongDim hInst As LongDim hmemberparent As LongDim hmemberchild As LongDim hNextSibling As LongDim poption As IntegerDim paccess As IntegerDim Items As IntegerDim name As Stringsts = EsbInit(Init, hInst)If sts = 0 Then sts = ConnectToSheet(gstrPRIMARY_SHT_NAME)End IfIf sts = 0 Then MsgBox "Connection made ", vbExclamation, "Connect process" hCtx = EssVGetHctxFromSheet(Null)Else MsgBox "Connection failed ", vbExclamation, "Connect process"End IfIf sts = 0 Then object.hCtx = hCtx object.Type = ESB_OBJTYPE_OUTLINE object.AppName = gstrAPP_NAME object.DbName = gstrDB_NAME object.FileName = gstrotl_name'Open outline sts = EsbOtlOpenOutline(hCtx, object, ESB_YES, ESB_YES, houtline) If sts = 0 Then MsgBox "Outline opened ", vbExclamation, "Outline open process"'Find member sts = EsbOtlFindMember(houtline, "Information Types", hmemberparent) If sts = 0 And hmemberparent <> 0 Then'Get Child sts = EsbOtlGetChild(houtline, hmemberparent, hmemberchild) If sts = 0 Then MsgBox "Child retrieved", vbExclamation, "Child process" If sts = 0 And hmemberchild <> 0 Then sts = EsbOtlGetNextSibling(houtline, hmemberchild, hNextSibling) If sts = 0 Then name = GetMemberName(hNextSibling) MsgBox name End If End If Else MsgBox "Child retrieval failed", vbExclamation, "Child process" End If Else MsgBox "Find member failed", vbExclamation, "Member process" End If Else MsgBox "Outline open failed ", vbExclamation, "Outline open process" End IfEnd If'frmMonth.ShowEnd Sub

  • DM 3.1.1 with SQL Server 2008 . Extended Properties not imported .

    Hi
    I am using Data Modeler 3.1.1 with SQL Server 2008.
    I have a database where I have Extended Properties (MS_Description) for the tables and columns.
    I use the Import Data Dictionary option (database type SQL 2005) , and the extended properties are not being imported to the model.
    Is there anything else that I should do to have the descriptions imported?
    Regards,
    Jorge

    Hi Fernando
    That is what I need to do.
    Create a Model from an existing SQL Server database with the Import data Dictionary option , be able to modify tables structures, extended properties in the model, and then sync those changes with the database.
    So far I can't import the extended properties with DM 3.1.1. If you find a way , please let me know.
    Thanks,
    Jorge

  • Export custom step properties for all sequences based upon expression

    I want to export only my custom step properties to a database. I realize this can be done one at a time but I'm looking for a more general, quicker solution since I have dozens of custom steps and many instances of each. I can probably do this, but if someone has already developed a method I could use the info. Thanks.
    kph 

    Hi kph,
    Unfortunately, there is not a straightforward way to solve this
    problem.  TestStand does not currently support any database
    configuration through programmatic means.  The customized database
    must be configured ahead of time.  I would handle the issue by
    setting up this database in configure >> Database Options. 
    The quickest solution for customization would be to duplicate one of
    the default Schemas (for example, Generic Recordset) under the "Schema"
    tab.  Under the statements tab, you can then cut out all of the
    unwanted statements (it sounds like you'll want to cut out most of
    them) and add new statments for your custom steps.   In this
    step, be sure to reference your custom step type for each statement in
    the "Types to Log" field.
    Under the Columns/Parameters tab, you can then add all of the properties you would like to save for each configured statement.
    At this point, you can use TestStand to create a SQL script file to
    match the Schema you just created.  From the Schema tab, you can
    select the Build .sql File dialog box.  After saving and running
    the script, you will have successfully created the required tables for
    the custom schema. 
    At this point, the custom properties should log to the database.
    Hope this helps in your application development!
    Andrew W. - Applications Engineer

  • Accessing list-backed properties in JSP

    Hello guys,
    I am trying to generate a dynamic form using the list-backed properties following the guide in
    http://struts.apache.org/struts-action/userGuide/building_controller.html#map_action_form_classes
    It works as a map but can't make it work as a list
    here is my jsp
    <html:form action ="/addTemplate.do">
         <%List attributesList = (List) request.getAttribute("attributesList");
                        Integer count = new Integer(attributesList.size());
                        session.setAttribute("count", count);
                        session.setAttribute("attributesList", attributesList);
                        for (int i = 0; i <= count; i++) {
                             String name = "value(addTemplate-" + i + ")";
         %>
    <!--make a list-->
              Attribute<%=i%>
                        <html:text property="<%= name %>"/>
              <br/>
              <%}%>
              <html:submit/>
              </html:form>and my bean
    public class AddTemplateForm extends ActionForm {
        private final Map values = new HashMap();
        public void setValue(String key, Object value) {
            values.put(key, value);
        public Object getValue(String key) {
            return values.get(key);
    }when I am trying to use a list , obviously modifying the bean and my jsp to
    String name = "value[" + i + ")";I am getting
    javax.servlet.ServletException: Exception thrown by getter for property value[0] of bean org.apache.struts.taglib.html.BEANusing a map I don;t really know how to get the properties values in the Action class
    Any help is appreciated

    try this.
    <html:select property="selectedCountries" multiple="true" size="4">
    <html:optionsCollection property="availableCountries" label="name" value="id">
    </html:select>
    public OptionsRecord
    // make corresponding setters and getters
    private String name;
    private String id;
    // constructor
    public OptionsRecord(String nm, String idd)
    name = nm;
    id = idd;
    ----- Form class ----
    public TestForm extends ActionForm
    // make setters and getters for the following.
    private String[] selectedCountries = new String[0];
    private Collection availableCountries = new LinkedList();
    init()
    availableCountries.add(new OptionsRecord("Australia", "001"));
    availableCountries.add(new OptionsRecord("Burma", "002"));
    availableCountries.add(new OptionsRecord("USA", "003"));
    Don't forget to reset selectedCountries to a new object.
    -----

Maybe you are looking for