SqlLogin Element (ADF)

Specifies the Microsoft SQL Server login account associated with the database user that runs the matching logic in condition actions.

语法

<ConditionAction>
    <SqlLogin>

Element Characteristics

Characteristic Description

Data type

string.

Default value

None.

Occurrence

Required once per ConditionAction element.

Updates

You can modify this element, but cannot add or delete it when updating the application. You can add and delete the parent ConditionAction element.

Element Relationships

Relationship Elements

Parent element

ConditionAction Element (ADF)

Child elements

None.

备注

All condition actions execute in the context of a database user that you specify for the condition action. Using a low-privileged user minimizes the security threat in case anyone compromises your subscription management interface and inserts conditions that attempt to access other tables or perform other actions.

You specify the database user in the SqlUser element. You specify the login account that is associated with the user in the SqlLogin element. The login must exist before Notification Services creates the application. If the login does not exist, Notification Services will fail when attempting to create the application and will roll back the instance creation or instance update. The login must continue to exist while the application is deployed.

The SqlLogin can be a SQL Server Authentication login or a Microsoft Windows Authentication login.

Make sure the login has restricted permissions on the server. It is best for the login to have no server-wide permissions and to belong to no server roles.

For more information condition actions, see 定义条件操作.

示例

The following example shows how to define a condition action. The query in the Transact-SQL expression selects data from the MyAppSchema.WeatherEventRule view, which contains data from the subscription class and from the MyAppSchema.WeatherEvents event view.

<ConditionAction>
    <SqlLogin>[MyLowPrivLogin]</SqlLogin>
    <SqlUser>[MyLowPrivUser]</SqlUser>
    <InputName>WeatherEvents</InputName>
    <InputSchema>MyAppSchema</InputSchema>
    <SqlExpression>
        INSERT INTO MyAppSchema.WeatherNotifications(SubscriberId, 
        DeviceName, SubscriberLocale, City, Forecast) 
        SELECT [Subscription.SubscriberId], [Subscription.DeviceName], 
            [Subscription.SubscriberLocale], [Input.City], 
            [Input.Forecast])
        FROM MyAppSchema.WeatherEventRule;
    </SqlExpression>
</ConditionAction>

请参阅

参考

SqlUser Element (ADF)
Application Definition File Reference

概念

Instance Configuration File Reference

其他资源

定义条件操作
定义订阅规则
CREATE LOGIN (Transact-SQL)

帮助和信息

获取 SQL Server 2005 帮助