What are the challenges you face when working across database platforms? Take the survey
Options

Auto Createapplication.dat for serverlist

dbdmoradbdmora Posts: 50
edited July 12, 2012 1:08PM in SQL Multi Script
How can we create a application.dat with out server list automatically?

multiple users use multiscript and we would like to auotmatically create the application.dat file on a daily basis when new SQL servers are online. This way anyone can copy the application.dat file to their local folder and get an upto date server list.

It used to work but something in the new version broke it.

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    Are you talking about the List Manager application? That's the only thing I know that could import a list of SQL Servers automatically. Is it because you're trying to connect to SQL Server 2012?
  • Options
    Hello Brian, I am actually talking about application.dat file that multiscript stores all the servers you added to the Database distribution list. We had a SSIS package that would create the application.dat file with our servers, where anyone can copy it to their PC. Now for some reason it is failing after upgrading multiscript. If someone can give us the correct string inside the application.dat file we need to follow, this will help us tremendously
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I'm not exactly sure what you're after but I can send you an XSD (schema definition file) of the applicaiton.dat and that may help.

    I also have a utility, although a bit clunky, which will detect all the databases you have access to on a network and add them to your dat file.

    ftp://support.red-gate.com/utilities/mu ... export.zip
  • Options
    Yes, please send me the XSD for application.dat. That will help us make sure our SSIS package is correct.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Here is the schema definition:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="MultiScriptApplication" nillable="true" type="MultiScriptApplication" />
      <xs:complexType name="MultiScriptApplication">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" name="DatabaseLists" type="ArrayOfDatabaseList" />
          <xs:element minOccurs="0" maxOccurs="1" name="AddedServers" type="ArrayOfServer" />
          <xs:element minOccurs="0" maxOccurs="1" name="Options" type="ApplicationOptions" />
          <xs:element minOccurs="0" maxOccurs="1" name="CurrentProject" type="xs:string" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="ArrayOfDatabaseList">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="DatabaseList" nillable="true" type="DatabaseList" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="DatabaseList">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:string" />
          <xs:element minOccurs="0" maxOccurs="1" name="Databases" type="ArrayOfDatabase" />
          <xs:element minOccurs="0" maxOccurs="1" name="ValidAndSelectedDatabases" type="ArrayOfDatabase" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="ArrayOfDatabase">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Database" nillable="true" type="Database" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Database">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1" name="Selected" type="xs:boolean" />
          <xs:element minOccurs="1" maxOccurs="1" name="Protocol" type="NetworkProtocol" />
          <xs:element minOccurs="1" maxOccurs="1" name="Timeout" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="PacketSize" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="EncryptConnection" type="xs:boolean" />
          <xs:element minOccurs="0" maxOccurs="1" name="ServerObject" type="Server" />
        </xs:sequence>
      </xs:complexType>
      <xs:simpleType name="NetworkProtocol">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Default" />
          <xs:enumeration value="SharedMemory" />
          <xs:enumeration value="NamedPipes" />
          <xs:enumeration value="TCPIP" />
          <xs:enumeration value="IPX" />
          <xs:enumeration value="MultiProtocol" />
          <xs:enumeration value="AppleTalk" />
          <xs:enumeration value="VIA" />
        </xs:restriction>
      </xs:simpleType>
      <xs:complexType name="Server">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" name="ServerName" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="IntegratedSecurity" type="xs:boolean" />
          <xs:element minOccurs="0" maxOccurs="1" name="UserName" type="xs:string" />
          <xs:element minOccurs="0" maxOccurs="1" name="Password" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="RememberPassword" type="xs:boolean" />
          <xs:element minOccurs="1" maxOccurs="1" name="Protocol" type="NetworkProtocol" />
          <xs:element minOccurs="1" maxOccurs="1" name="Timeout" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="PacketSize" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="EncryptConnection" type="xs:boolean" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="ArrayOfServer">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Server" nillable="true" type="Server" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="ApplicationOptions">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1" name="ExecutionTimeout" type="xs:int" />
          <xs:element minOccurs="0" maxOccurs="1" name="BatchSeparator" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="DisplayFormat" type="DisplayFormat" />
          <xs:element minOccurs="1" maxOccurs="1" name="MaximumNonXMLDataRetrieved" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="MaximumXMLDataRetrieved" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="MaximumCharactersPerColumn" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="UseParallelExecution" type="xs:boolean" />
          <xs:element minOccurs="1" maxOccurs="1" name="MaximumParallelServers" type="xs:int" />
          <xs:element minOccurs="0" maxOccurs="1" name="ScriptEncoding" type="Encoding" />
        </xs:sequence>
      </xs:complexType>
      <xs:simpleType name="DisplayFormat">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Grid" />
          <xs:enumeration value="Text" />
        </xs:restriction>
      </xs:simpleType>
      <xs:complexType name="Encoding" abstract="true">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" name="EncoderFallback" type="EncoderFallback" />
          <xs:element minOccurs="0" maxOccurs="1" name="DecoderFallback" type="DecoderFallback" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="EncoderFallback" abstract="true" />
      <xs:complexType name="DecoderFallback" abstract="true" />
    </xs:schema>
    
  • Options
    Brian, thanks for replying so quickly. when I open application.dat file with notepad++ I don't see the same thing as below. I am running version 1.1.0.34. Am i on the latest version? Thanks

    P.S this is what I see
    <?xml version="1.0" encoding="utf-16" standalone="yes"?><!--
    SQL Multi Script 1
    SQL Multi Script
    Version:1.1.0.34--><multiScriptApplication version="2" type="multiScriptApplication"><databaseLists type="List_databaseList" version="1"><value version="2" type="databaseList"><name>Default Distribution List</name><databases type="BindingList_database" version="1" /><guid>c84c1b63-faa3-426c-ba7e-feb4473355a2</guid></value></databaseLists><addedServers type="List_server" version="1" /></multiScriptApplication>
    
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    The above is the complete schema definition -- it defines the rules of how the file should be formatted. If it doesn't make any sense I'm afraid I can't really help you because you need to have a good understanding of xsd/xml to know what is wrong in the document.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Just had a look and it may be a case-sensitivity issue? In the XSD, it's MultiScriptApplication and in your file it's multiScriptApplication...
  • Options
    Brian, it is not a case sensative issue. The XML below is coming from what MultiScript automatically creates into application.dat file.

    Is it possible the SSIS package encoding output is wrong? Sometimes if we copy the contents inside the app.dat file we create into the one that Multiscript creates, it works.

    What type of file encoding does multiscript use to create application.dat. that might be the issue because all the XML is correct. If we ouput as plain text and just rename the file extension to .dat, multiscript re-encodes but blanks out the inside content, if that makes sense.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    MultiScript should be producing UTF-8 XML.
  • Options
    dbdmora, have you been able to resolve this issue? I am at my wits end...
Sign In or Register to comment.