如何创建用于在分析服务项目中配置连接字符串的文件



在Analysis Services项目中,我在olap.ds中设置了ConnectionString,它运行良好。

但是,每次更改数据库的密码时,我都需要再次部署项目,因为我只能在olap.ds文件中配置它。

有什么方法可以设置配置文件来管理连接字符串吗?所以我只需要修改配置文件而不是重新部署项目。

感谢您的帮助。

您可以使用 XMLA 脚本。以下是AdwentureWorks Cube的示例。可以从 SSMS 或 PowerShell 运行此类脚本。

<Alter AllowCreate="true" ObjectExpansion="ObjectProperties" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
    <DatabaseID>AdventureWorksDW2012Multidimensional-EE</DatabaseID>
    <DataSourceID>Adventure Works DW</DataSourceID>
</Object>
<ObjectDefinition>
    <DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xsi:type="RelationalDataSource">
        <ID>Adventure Works DW</ID>
        <Name>AdventureWorksDW2012</Name>
        <ConnectionString>Provider=SQLNCLI11.1;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=AdventureWorksDW2012</ConnectionString>
        <ImpersonationInfo>
            <ImpersonationMode>ImpersonateAccount</ImpersonationMode>
                <Account>domainlogin</Account>
                <Password>password</Password>
        </ImpersonationInfo>
        <Timeout>PT0S</Timeout>
    </DataSource>
</ObjectDefinition>


请注意,您必须使用 Windows 域帐户进行数据访问,或将您的登录名和密码以纯文本形式存储在连接字符串中。

最新更新