The Power of Custom Tokens

The Power of Custom Tokens
CondorMan's picture

A useful feature that allows you to use any data in your Deployment Server database in a script task is Custom Tokens. The syntax for a custom token is %#*"Your SQL Query Here"%. Here are some custom tokens that might come in handy.

%#*"SELECT GETDATE()"%

will return the current date and time.

%#*"SELECT @@servername"%

will return the name of the SQL Server.

%#*"SELECT g.name FROM computer c, computer_group g WHERE c.group_id = g.group_id AND c.computer_id = %ID%"%

will return the name of the group that this computer is a member of.

3.69231
Average: 3.7 (26 votes)