Cannot determine the service account for SQL Server instance

Microsoft.SQLServer.2012.Cannot_determine_the_service_account_for_SQL_Server_instance_1_5_Rule (Rule)

Knowledge Base article:

Causes

This error occurs when a Transact-SQL statement contains mismatched single or double quotes. The SET QUOTED_IDENTIFIER setting will determine which combinations of single and double quotations marks are valid. For more information about SET QUOTED_IDENTIFIER, see "SET QUOTED_IDENTIFIER" in Books Online.

Each single or double quotation mark used to mark the beginning of a literal string must have a corresponding quotation mark of the same type to mark the end of the literal string. A single quotation mark cannot be paired with a double quotation mark to delimit a single literal string.

Quotation marks that are part of the literal string are handled differently. If a single quotation mark (') is part of the literal string, it can be represented by two single quotation marks (''). If a literal string is delimited by double quotation marks and SET QUOTED_IDENTIFIER is OFF, the string can contain embedded single quotation marks, such as apostrophes. If a literal string is delimited by single quotation marks and SET QUOTED_IDENTIFIER is either ON or OFF, the string can contain embedded double quotation marks.

If you do not place the correct type and number of quotation marks in each place in your code, SQL Server will return the above error, possibly along with an "Incorrect syntax near %" error.

For more information about managing quotation marks in the code, see these Microsoft Knowledge Base articles:

311023 and 311021.

For examples of quotation mark usage, see "SET QUOTED_IDENTIFIER" in Books Online.

Resolutions

SELECT SESSIONPROPERTY('QUOTED_IDENTIFIER')

Depending on your needs, you may need to change the setting with SET QUOTED_IDENTIFIER ON/OFF.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Priority

Defines Alert Priority.

1

Severity

Defines Alert Severity.

1

Element properties:

TargetMicrosoft.SQLServer.2012.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID14353
Event Source$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
Cannot determine the service account for SQL Server instance
{0}
Event LogApplication
CommentMom2012ID='{9F3F26E8-EB1A-479F-A53F-BA44C789022D}';MOM2012GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.Windows.EventProvider Microsoft.SQLServer.SQLDefaultAccount
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2012.Cannot_determine_the_service_account_for_SQL_Server_instance_1_5_Rule" Target="SQL2012Core!Microsoft.SQLServer.2012.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2012ID='{9F3F26E8-EB1A-479F-A53F-BA44C789022D}';MOM2012GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Windows!Microsoft.Windows.EventProvider" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>14353</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2012.Cannot_determine_the_service_account_for_SQL_Server_instance_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>