Sunday, February 19, 2012

How to define token syntax in MSSQL2005 sp1?

There is one token in my Agent Job $WMI(DatabaseName)

Now,I defined this using $(ESCAPE_NONE(WMI(DatabaseName)))

but failed and prompted: Variable WMI(DatabaseName) not found

What should i do for this? thanks

From the updated books online:

For jobs that run in response to WMI alerts, the value of the property specified by property. For example, $(WMI(DatabaseName)) provides the value of the DatabaseName property for the WMI event that caused the alert to run.

So I believe you don't need the ESCAPE_NONE...

|||

If do not add ESCAPE_NONE,prompt "For SQL Server 2005 Service Pack 1 or later, all job steps with tokens must be updated with a macro before the job can run"

Discover In SQL Server 2005 SP1, the SQL Server Agent job step token syntax has changed

url:http://support.microsoft.com/kb/915845

I want to do something for each database just was created,So I could not specifiy the value of database, how to deal with that? thanks

|||

Perhaps the tokens remain disabled?

Because access to Eventlog is not always secured, the alerts are disabled by default. To get the substitutions to work, you should ensure that only members of trusted groups have write permissions to Eventlog, then enable these tokens on the Agent Properties Dialog Alert System tab, or you can set the AlertReplaceRuntimeTokens reg key.

jkh

No comments:

Post a Comment