Home
SQL Size online help Prev Page Prev Page
Introduction
About SQL Size
Version history
Contact us
User Guide
Architecture
Licensing
Installation
System requirements
Reference Guide
The SQL Size Agent service
The SQL Size Configuration application
SQL Server instances
Data collection schedule
Reports and emails
Report template
Data storage
Alerts
Script editor
Useful shortcuts
Activating your license
The SQL Size database
The SQL Size GUI
The Overview page
Export overview
Database analysis
Alerts history
Error history
Scripting
Data types
Script structure
Language basics
Debugging
Global variables
Functions
Alert functions
RaiseAlert
RaiseConditionalAlert
AddAlertDetails
Mathematical functions
Power
String formatting functions
FormatBytes
FormatFloat
Support functions
String functions
Date and time functions
Date-Time format strings
Class reference
TBaseClass
Properties
AverageDailyGrowth
Name
ObjectType
Size
SizeDesc
Tag
TInstance
Properties
Database
DatabaseByName
DatabaseCount
DatabaseDataSize
DatabaseExists
DatabaseFilestreamSize
DatabaseLogSize
DatabaseSize
PathCount
Path
TDatabase
Properties
DataSize
DBFile
DBFileCount
Filegroup
FilegroupCount
FilestreamSize
LogSize
TFilegroup
Properties
DBFile
DBFileCount
FilegroupType
TDBFile
Properties
Filegroup
FileType
Growth
IsPercentGrowth
MaxSize
Path
PhysicalName
TPath
Properties
FreeSpace
Enumerations
TFileType
TFilegroupType
TObjectType
Records
TGrowthStats
Constants

Script structure

Every script in SQL Size requires a Main procedure. It as defined as such:

scripts_structure_01  
 
Each line needs to be terminated with a semi-colon (;), except for a begin block. Functions and procedures need to be defined before they can be called. The following script is invalid because Foo is called before it is defined.

scripts_structure_02  
 
The script needs to be rewritten to define Foo before it is called i.e.

scripts_structure_03  
 
This basically means that the Main procedure is usually the last procedure in the script, if it calls other procedures and functions.

Every procedure and function must contain a begin..end block. Variables are defined using the var keyword, and is defined before the begin block. You can define variables for the basic data types, and also for the classes supported by the script engine.

scripts_structure_04