SQL Query Template
Log In or Register to download the BES file, and more.

1 Votes

Description

Run a sql command and store results to file.

Property Details

ID640
TitleSQL Query Template
DomainBESC
CategoryCommon Tasks
Download Size0
Sourcedanielheth@bigfix.me
Source ID<Unspecified>
Source Severity<Unspecified>
Source Release Date10/26/2012 12:00:00 AM
KeywordsMSSQL
Is TaskTrue
Added by on 10/26/2012 11:59:35 AM
Last Modified by on 10/26/2012 11:59:35 AM
Counters 7222 Views / 45 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

isWindows (Relevance 274)
Used in 584 fixlets and 3 analyses   * Results in a true/false
Show indented relevance
name of operating system starts with "Win"
Used in 1 fixlet   * Results in a true/false
Show indented relevance
(( exists key whose (value "DisplayName" of it as string contains "Microsoft SQL Server 2000" AND value "DisplayVersion" of it as string as version = "8") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) AND NOT exists key "HKLM\SOFTWARE\Microsoft\MSSQLServer" whose (NOT exists key whose (name of it != "Client") of it) of registry) OR (disjunction of (exists key whose (exists key "Setup" whose (exists value "Edition" of it AND (value "Version" of it as string as version = "9" OR value "Version" of it as string as version = "10") AND value "Edition" of it != "Express Edition") of it ) of keys "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server" of ((if x64 of operating system then x64 registry else nothing) ; registry)))

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
delete __appendfile
appendfile set nocount on
appendfile select name from sys.databases where name = 'pubs' or name = 'Northwind'
delete statement.sql
move __appendfile statement.sql
waithidden sqlcmd -E -n -w 1200 -W -h-1 -s "~" -i statement.sql -o "{(pathname of parent folder of client)}\sql_result.txt" -b
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!