Database Reference
In-Depth Information
Listing
1-9
.
T-SQL
Code
to
Update
the
LastMonitored
Value
in
dba_monitor_SQLServerInstances
UPDATE dbo.dba_monitor_SQLServerInstances
SET LastMonitored = GETDATE()
WHERE SQLServerInstance= ?;
The question mark (
?
) informs the Execute SQL task to use a parameter to com-
plete the SQL statement. Now you just need to map a variable to the parameter. To do
this, click the Parameter Mapping page and click Add. Edit the properties as follows:
• Variable Name =
User::SQLServerInstance
• Direction =
Input
• Data Type =
NVARCHAR
• Parameter Name =
0
• Parameter Size =
128
Confirm that your mappings match those shown in
Figure 1-21
, and then click OK.
Figure 1-21
.
Parameter mapping in the Execute SQL Task Editor
You are now ready to execute your package! To do this, select Debug Start De-
bugging from the menu, click the green Run icon in the toolbar, or press F5. Your
package should resemble
Figure 1-22
when successfully executed.
Search WWH ::
Custom Search