Ms Maestro
Ms Maestro
User's guide
Table of Contents
Foreword 0
II Getting Started 12
1 Connect
...................................................................................................................................
to a database 13
2 Connection
...................................................................................................................................
parameters 14
3 Explaining
...................................................................................................................................
user interface 15
First time started
.......................................................................................................................................................... 16
Tabbed MDI .......................................................................................................................................................... 17
Switching between
..........................................................................................................................................................
windows 19
4 Shortcut
...................................................................................................................................
keys 21
Permissions.........................................................................................................................................................
of the Object 48
Object grants
......................................................................................................................................................... 49
Object Dependencies
......................................................................................................................................................... 50
SQL Definition
......................................................................................................................................................... 51
Parameter .........................................................................................................................................................
Editor 52
Executing .........................................................................................................................................................
functions and procedures 52
Modify Object..........................................................................................................................................................
Properties 53
Describe Objects
.......................................................................................................................................................... 54
3 Duplicate
...................................................................................................................................
Objects 55
Duplicate Object
..........................................................................................................................................................
Wizard 55
Selecting source
.........................................................................................................................................................
and destination databases 55
Selecting object
.........................................................................................................................................................
to duplicate 56
Modifying new
.........................................................................................................................................................
object definition 57
Duplicate Selected
..........................................................................................................................................................
Object 57
Copy, Paste and
..........................................................................................................................................................
Drag-n-Drop features 58
4 Browse
...................................................................................................................................
Objects 60
Database Explorer.......................................................................................................................................................... 60
Filtering explorer
.........................................................................................................................................................
content 63
Object Browser .......................................................................................................................................................... 64
Object Manager .......................................................................................................................................................... 65
Filter Builder Dialog
.......................................................................................................................................................... 66
V Database Objects 68
1 Schemas
................................................................................................................................... 69
Create Schema
..........................................................................................................................................................
Wizard 70
Schema Editor.......................................................................................................................................................... 72
2 Tables................................................................................................................................... 75
Create Table ..........................................................................................................................................................
Wizard 76
Table Editor .......................................................................................................................................................... 78
Editing table
.........................................................................................................................................................
properties 78
Managing table
.........................................................................................................................................................
data 80
Fields .......................................................................................................................................................... 82
Indexes .......................................................................................................................................................... 86
Foreign Keys .......................................................................................................................................................... 89
Checks .......................................................................................................................................................... 91
Default constraints
.......................................................................................................................................................... 93
Triggers .......................................................................................................................................................... 96
Create Trigger
.........................................................................................................................................................
Wizard 97
Trigger Editor
......................................................................................................................................................... 98
CLR Triggers.......................................................................................................................................................... 100
Create CLR.........................................................................................................................................................
Trigger Wizard 101
CLR Trigger
.........................................................................................................................................................
Editor 102
Foreign Key ..........................................................................................................................................................
References 103
3 Views
................................................................................................................................... 106
Create View ..........................................................................................................................................................
Wizard 107
View Editor .......................................................................................................................................................... 112
Editing view
.........................................................................................................................................................
properties 113
Viewing data
......................................................................................................................................................... 115
4 Procedures
................................................................................................................................... 116
Create Procedure
..........................................................................................................................................................
Wizard 117
Specifying.........................................................................................................................................................
procedure options 118
Managing.........................................................................................................................................................
parameters 120
II
III MS SQL Maestro Help
Specifying .........................................................................................................................................................
procedure definition 120
Procedure Editor
.......................................................................................................................................................... 121
Editing properties
......................................................................................................................................................... 122
Viewing procedure
.........................................................................................................................................................
results 124
5 UDFs................................................................................................................................... 126
Create UDF Wizard
.......................................................................................................................................................... 127
UDF Editor .......................................................................................................................................................... 130
Editing properties
......................................................................................................................................................... 130
Viewing UDF.........................................................................................................................................................
results 132
6 UDTs................................................................................................................................... 134
Create UDT Wizard
.......................................................................................................................................................... 135
UDT Editor .......................................................................................................................................................... 137
7 Synonyms
................................................................................................................................... 139
Create Synonym
..........................................................................................................................................................
Wizard 140
Synonym Editor
.......................................................................................................................................................... 141
Editing synonym
.........................................................................................................................................................
properties 141
8 Rules................................................................................................................................... 143
Create Rule ..........................................................................................................................................................
Wizard 144
Rule Editor .......................................................................................................................................................... 145
Editing rule
.........................................................................................................................................................
properties 145
9 Defaults
................................................................................................................................... 148
Create Default
..........................................................................................................................................................
Wizard 149
Default Editor.......................................................................................................................................................... 150
Editing default
.........................................................................................................................................................
properties 150
10 File Tables
................................................................................................................................... 152
11 CLR Procedures
................................................................................................................................... 154
Create CLR Procedure
..........................................................................................................................................................
Wizard 155
CLR Procedure ..........................................................................................................................................................
Editor 156
Editing properties
......................................................................................................................................................... 157
Executing.........................................................................................................................................................
CLR procedure 158
12 CLR UDFs
................................................................................................................................... 159
Create CLR UDF
..........................................................................................................................................................
Wizard 160
CLR UDF Editor
.......................................................................................................................................................... 161
Editing CLR
.........................................................................................................................................................
UDF properties 162
13 CLR UDTs
................................................................................................................................... 164
Create CLR UDT
..........................................................................................................................................................
Wizard 165
CLR UDT Editor
.......................................................................................................................................................... 165
14 XML ...................................................................................................................................
Schema Collection 167
Create XML Schema
..........................................................................................................................................................
Collection Wizard 168
XML Schema..........................................................................................................................................................
Collection Editor 169
15 Queues
................................................................................................................................... 171
Create Queue ..........................................................................................................................................................
Wizard 172
Queue Editor.......................................................................................................................................................... 173
Editing queue
.........................................................................................................................................................
properties 173
Managing.........................................................................................................................................................
queue data 174
16 Message
...................................................................................................................................
types 177
Create Message
..........................................................................................................................................................
Type Wizard 178
Message Type ..........................................................................................................................................................
Editor 178
Editing message
.........................................................................................................................................................
type properties 179
17 Contracts
................................................................................................................................... 180
Create Contract
..........................................................................................................................................................
Wizard 181
Contract Editor
.......................................................................................................................................................... 181
Contract Properties
.......................................................................................................................................................... 182
18 Services
................................................................................................................................... 183
Create Service
..........................................................................................................................................................
Wizard 184
Service Editor
.......................................................................................................................................................... 184
Editing service
.........................................................................................................................................................
properties 185
19 Conversations
................................................................................................................................... 186
Create Conversation
..........................................................................................................................................................
Wizard 187
Conversation..........................................................................................................................................................
Editor 188
Editing conversation
.........................................................................................................................................................
properties 189
20 Aggregates
................................................................................................................................... 190
Create Aggregate
..........................................................................................................................................................
Wizard 191
Aggregate Editor
.......................................................................................................................................................... 192
Editing aggregate
.........................................................................................................................................................
properties 193
21 Sequences
................................................................................................................................... 194
Create Sequence
..........................................................................................................................................................
Wizard 195
Sequence Editor
.......................................................................................................................................................... 196
22 Users................................................................................................................................... 199
Create User ..........................................................................................................................................................
Wizard 199
User Editor .......................................................................................................................................................... 200
Editing user
.........................................................................................................................................................
properties 200
23 Roles................................................................................................................................... 202
Create Role ..........................................................................................................................................................
Wizard 203
Role Editor .......................................................................................................................................................... 204
24 Files ................................................................................................................................... 206
25 File Groups
................................................................................................................................... 209
File Group Properties
.......................................................................................................................................................... 210
26 Assemblies
................................................................................................................................... 212
Create Assembly
..........................................................................................................................................................
Wizard 213
Assembly Editor
.......................................................................................................................................................... 214
Assembly.........................................................................................................................................................
properties 214
27 Asymmetric
...................................................................................................................................
Keys 216
Create Asymmetric
..........................................................................................................................................................
Key Wizard 217
Asymmetric ..........................................................................................................................................................
Key Editor 218
Editing asymmetric
.........................................................................................................................................................
key properties 218
28 Symmetric
...................................................................................................................................
Keys 220
Create Symmetric
..........................................................................................................................................................
Key Wizard 221
Symmetric Key
..........................................................................................................................................................
Editor 221
Symmetric
.........................................................................................................................................................
Key Properties 222
29 Certificates
................................................................................................................................... 223
Create Certificate
..........................................................................................................................................................
Wizard 224
Certificate Editor
.......................................................................................................................................................... 225
Editing certificate
.........................................................................................................................................................
properties 226
30 DDL Triggers
................................................................................................................................... 228
Create DDL Trigger
..........................................................................................................................................................
Wizard 229
DDL Trigger ..........................................................................................................................................................
Editor 230
Editing DDL
.........................................................................................................................................................
trigger properties 230
IV
V MS SQL Maestro Help
31 CLR DDL
...................................................................................................................................
Triggers 232
Create CLR DDL
..........................................................................................................................................................
Trigger Wizard 233
Specifying.........................................................................................................................................................
CLR DDL trigger options 233
CLR DDL Trigger
..........................................................................................................................................................
Editor 234
Editing CLR
.........................................................................................................................................................
DDL trigger properties 234
32 Table...................................................................................................................................
Types 236
Create Table..........................................................................................................................................................
Type Wizard 236
Table Type Editor
.......................................................................................................................................................... 237
10 Categories
................................................................................................................................... 287
Create Category
..........................................................................................................................................................
Wizard 288
Specifying.........................................................................................................................................................
category options 288
Category Editor
.......................................................................................................................................................... 289
Editing category
.........................................................................................................................................................
properties 290
11 Alerts................................................................................................................................... 292
Create Alert ..........................................................................................................................................................
Wizard 293
Specifying.........................................................................................................................................................
alert options 293
Setting operator
.........................................................................................................................................................
the alert to give notify of 295
Alert Editor .......................................................................................................................................................... 295
Editing alert
.........................................................................................................................................................
properties 296
12 Credentials
................................................................................................................................... 299
Create Credential
..........................................................................................................................................................
Wizard 300
Specifying .........................................................................................................................................................
credential options 300
Credential Editor
.......................................................................................................................................................... 301
Editing credential
.........................................................................................................................................................
properties 302
13 Server
...................................................................................................................................
logs 304
14 Linked
...................................................................................................................................
servers 305
Create Linked
..........................................................................................................................................................
Server Wizard 306
Linked Server
..........................................................................................................................................................
Editor 307
Remote Logins
.......................................................................................................................................................... 307
VI
VII MS SQL Maestro Help
Setting common
..........................................................................................................................................................
export options 348
4 Get SQL
...................................................................................................................................
Dump 349
Selecting fields
.......................................................................................................................................................... 349
Specifying dump
..........................................................................................................................................................
options 350
5 Import
...................................................................................................................................
Data Wizard 352
Setting source..........................................................................................................................................................
file name and format 353
Setting the accordance
..........................................................................................................................................................
between source and target columns 355
Map builder
......................................................................................................................................................... 356
Data formats
......................................................................................................................................................... 357
Customizing ..........................................................................................................................................................
common options 358
15 DML ...................................................................................................................................
procedures generation 407
16 Generation
...................................................................................................................................
of updatable views 409
17 Split ...................................................................................................................................
table 410
18 Nullable
...................................................................................................................................
Column Checker 412
19 Dialogs
................................................................................................................................... 414
Find Text dialog
.......................................................................................................................................................... 414
Replace Text..........................................................................................................................................................
dialog 415
XI Options 422
1 Application
................................................................................................................................... 423
Preferences.......................................................................................................................................................... 423
Confirmations .......................................................................................................................................................... 424
Directories .......................................................................................................................................................... 426
Tools .......................................................................................................................................................... 426
Explorer ......................................................................................................................................................... 428
Object Manager
......................................................................................................................................................... 429
SQL Editor ......................................................................................................................................................... 429
SQL Script .........................................................................................................................................................
Editor 430
Query Builder
......................................................................................................................................................... 431
Colors ......................................................................................................................................... 433
BLOB Viewer......................................................................................................................................................... 433
Data Export......................................................................................................................................................... 434
Database.........................................................................................................................................................
Designer 435
Object Editors .......................................................................................................................................................... 436
Table ......................................................................................................................................................... 438
Data Grid .......................................................................................................................................................... 438
Options ......................................................................................................................................................... 440
Colors ......................................................................................................................................................... 441
Formats ......................................................................................................................................................... 442
Filter ......................................................................................................................................................... 443
2 Editors
...................................................................................................................................
& Viewers 445
General .......................................................................................................................................................... 445
Display .......................................................................................................................................................... 446
SQL highlight.......................................................................................................................................................... 447
XML highlight
.......................................................................................................................................................... 448
PHP highlight.......................................................................................................................................................... 449
Code Insight.......................................................................................................................................................... 450
Code Folding.......................................................................................................................................................... 451
3 Appearance
................................................................................................................................... 453
Bars and menus
.......................................................................................................................................................... 453
Trees and lists
.......................................................................................................................................................... 454
Edit controls.......................................................................................................................................................... 455
VIII
IX MS SQL Maestro Help
Index 465
Security management
MS SQL Maestro gives you a comfortable access to Microsoft SQL security features.
Server environment
1.2 Installation
To install MS SQL Maestro for the first time on your PC:
· download the MS SQL Maestro distribution package from the download page at our
site;
· run setup.exe from the local folder and follow the instructions of the installation
wizard;
· find the MS SQL Maestro shortcut in the corresponding program group of the
Windows Start menu after the installation is completed.
· download the MS SQL Maestro executable file from the download page at our site;
· unzip downloaded file to any local folder, e.g. c:\unzipped;
· exit from MS SQL Maestro if it is running;
· replace previous version of MS SQL Maestro by copying unzipped files to the MS SQL
Maestro folder;
· run MS SQL Maestro using its shortcut in the Windows Start menu.
You can also use the full distribution package to upgrade your current version of MS SQL
Maestro. In this case you should repeat the steps of the first-time installation. Note
that the full distribution package is larger than a single executable file.
You can select licensing options and register MS SQL Maestro at its on-line order page.
It is possible to purchase on-line, by fax, mail, toll-free phone call, or place a purchase
order. We send the software activation key by email within 24 hours after completion of
the order process. If you have not received the activation key within this period, please
contact our sales department.
All our products and bundles are shipped with 12 months of free upgrades (minor and
major ones) or with 36 months of free upgrades for a quite small additional fee. After this
period you may renew your license for the next 12(36) months with a 50% discount.
MS SQL Maestro has a free 30-day trial. Upon purchasing the product you confirm that
you have tested it and you are completely satisfied with its current version.
To obtain technical support, please visit the appropriate section on our website or
contact us by email to [email protected].
· License grant. SQL Maestro Group grants you a license to use one copy of the
version of this SOFTWARE on any single hardware product for as many licenses as you
purchase. "You" means a company, an entity or an individual. "Use" means storing,
loading, installing, executing or displaying the SOFTWARE. You may not modify the
SOFTWARE or disable any licensing or control features of the SOFTWARE except as an
intended part of the SOFTWARE's programming features. This license is not
transferable to any other company, entity or individual. You may not publish any
registration information (serial numbers, registration keys, etc.) or pass it to any other
company, entity or individual.
· Ownership. The SOFTWARE is owned and copyrighted by SQL Maestro Group. Your
license confers no title or ownership of the SOFTWARE and should not be construed as
a sale of any rights for the SOFTWARE.
· Copyright. The SOFTWARE is protected by the United States copyright law and
international treaty provisions. You acknowledge that no title to the intellectual
property in the SOFTWARE is transferred to you. You further acknowledge that title
and full ownership rights to the SOFTWARE will remain the exclusive property of SQL
Maestro Group and you will not acquire any rights to the SOFTWARE except as
expressly set forth in this license. You agree that any copies of the SOFTWARE will
contain the same proprietary notices which appear on and in the SOFTWARE.
· replace existing version of the UNREGISTERED SOFTWARE installation package with the
new package immediately after a new version of the SOFTWARE is released by SQL
Maestro Group, or
· delete an obsolete version of the UNREGISTERED SOFTWARE installation package
immediately upon written email notice by SQL Maestro Group.
A registered copy of the SOFTWARE ("REGISTERED SOFTWARE") allows you to use the
SOFTWARE only on a single computer and only by a single user at a time. If you wish to
use the SOFTWARE for more than one user, you will need a separate license for each
individual user. You are allowed to make one copy of the REGISTERED SOFTWARE for
back-up purposes.
· Reverse engineering. You affirm that you will not attempt to reverse compile,
modify, translate, or disassemble the SOFTWARE in whole or in part.
· Unauthorized use. You may not use, copy, rent, lease, sell, modify, decompile,
disassemble, otherwise reverse engineer, or transfer the SOFTWARE except as
provided in this agreement. Any such unauthorized use shall result in immediate and
· No other warranties. SQL Maestro Group does not warrant that the SOFTWARE is
error-free. SQL Maestro Group disclaims all other warranties with respect to the
SOFTWARE, either express or implied, including but not limited to implied warranties of
merchantability, fitness for a particular purpose and noninfringement of third party
rights. Some jurisdictions do not allow the exclusion of implied warranties or limitations
on how long an implied warranty may last, or the exclusion or limitation of incidental or
consequential damages, so the above given limitations or exclusions may not apply to
you. This warranty gives you specific legal rights and you may also have other rights
which vary from jurisdiction to jurisdiction.
· Limited warranty. This SOFTWARE is provided on an "AS IS" basis. SQL Maestro
Group disclaims all warranties relating to this SOFTWARE, whether expressed or
implied, including but not limited to any implied warranties of merchantability or fitness
for a particular purpose. Neither SQL Maestro Group nor anyone else who has been
involved in the creation, production, or delivery of this SOFTWARE shall be liable for
any indirect, consequential, or incidental damages arising out of the use or inability to
use such SOFTWARE, even if SQL Maestro Group has been advised of the possibility of
such damages or claims. The person using the SOFTWARE bears all risk as to the
quality and performance of the SOFTWARE.
· Severability. In the event of invalidity of any provision of this license, the parties
agree that such invalidity shall not affect the validity of the remaining portions of this
license.
· No liability for consequential damages. In no event shall SQL Maestro Group or its
suppliers be liable to you for any consequential, special, incidental or indirect damages
of any kind arising out of the delivery, performance or use of the SOFTWARE, even if
SQL Maestro Group has been advised of the possibility of such damages. In no event
will SQL Maestro Group's liability for any claim, whether in contract, tort or any other
theory of liability, exceed the license fee paid by you, if any.
· Entire agreement. This is the entire agreement between you and SQL Maestro Group
which supersedes any prior agreement or understanding, whether written or oral,
relating to the subject matter of this license.
· Reserved rights. All rights not expressly granted here are reserved to SQL Maestro
Group.
The company was founded in 2002 as an essential partner for every business that is
trying to harness the explosive growth in corporate data. SQL Maestro Group employs an
international team concentrating their efforts on cutting-edge DBA tools development.
The slogan of our company is The Shortest Path to SQL. It is aimed to denote that we
set to create easy-to-use products meant for those who appreciate comfort, friendly
program interface and support when working with SQL servers.
At present, our company offers a series of Windows GUI admin tools for SQL
management, control and development of the following servers: MySQL, Microsoft SQL
Server, PostgreSQL, Oracle, SQL Anywhere, DB2, SQLite, Firebird, and MaxDB. We
also produce universal tools to be used for administering any database engine accessible
via ODBC driver or OLE DB provider. Such products may be the clear-cut decision for
those who constantly work with several database servers.
The software products are constantly optimized for the latest server versions support.
2 Getting Started
The topics in this section provide some basic information about MS SQL Maestro, what it
is for and what you can do with it.
· Shortcut keys 21
Learning more:
q See Database Tools 360 and Queries 309 sections for instructions on more
advanced procedures!
q Find out more about Working with Data in MS SQL Maestro 325 .
q Customize the way MS SQL Maestro works, see Program Options 422 for full
details.
When the profile is created you can connect to the database. To do so, select the
database in the Explorer tree 60 , or either select the Database | Connect to Database
main menu item or use the Connect to Database item of the popup menu. You can also
double click the database node in the explorer tree. If connection succeeds, the
database node expands displaying the tree of database objects (tables, views,
procedures, etc). The database becomes ready for your activities.
In order to disconnect from a database you should first select the database in the
explorer tree, then either
Provider
The application allows you to connect to SQL Server using any of SQL Server Native
Clients installed on your computer. To choose a client you want to use, select the
appropriate item in the Provider combobox. The table below shows the correspondence
between the value selected in this combobox and SQL Server client to be used.
We would recommend you to install and use SQL Server 2012 Native Client as it (and
only it) supports SQL Server Express LocalDB. Also it provides the best support for data
types implemented in the recent versions of SQL Server.
This topic provides a brief guide to the components of MS SQL Maestro's user interface.
For detailed descriptions, see below.
Database Explorer
The Database Explorer 60 occupies the left side of MS SQL Maestro main window. It
represents all the connected databases objects including system objects 28 .
The explorer provides the fastest way to reach the object properties, to perform the
following operations with database profiles using the popup menu:
According to the MDI style implementation the MS SQL Maestro tools and editors are
opened in appropriate windows. Each window consists of a navigation bar and work
area. The software supports Classic and Tabbed MDI.
Navigation bar
The Navigation Bar contains a set of logically grouped links provided to realize the
corresponding actions. Just position the mouse over a link and wait for a second to
display the appropriate action shortcut making it possible for experienced users to
control the program almost entirely with the keyboard.
Toolbars
The bars occupy the top of the main window. The Toolbars provide quick access to the
most frequently-used functions. Just position the mouse over a tool and wait for a
second to display a brief text describing what it is for.
The window provides you with quick access to the Create Database Object 43 dialog,
Schema Designer 399 , SQL Editor 311 , and SQL Script Editor 362 recently used database
profiles. At the bottom of the page the latest company news and current discount
programs are represented.
Applying the style you'll get all the objects editors opening on separate sheets. You can
move from one sheet to another by clicking the sheet tabs at the bottom of the working
area. The tab for the active sheet is underlined in the color you choose; tabs for
inactive sheets are fully colored.
You can switch between the sheets with corresponding sheet tabs or using Ctrl+Tab. If
you don't see the tool you want, click the tab scrolling buttons to display the tab, and
then click the tab. You can also move the sheets.
Most of the windows are linked according to their active databases and displayed in the
form of a tree, e.g. Table Editor, SQL Editor, Diagram Viewer, etc. Windows which are
common for the entire program are shown as separate nodes of the tree.
To activate the window you need, select one of the window tree items and click the OK
button.
Interface 15
Use for this purpose Create Database Wizard 33 . In order to run the
wizard you should either
Using Create Database Wizard set the Create profile after creating the
database option to create a new profile and open the Database Profile
Properties dialog after the database is created.
To edit a database:
Check the Create a single profile option to set the database name manually and
create a single profile for this database.
You can select several databases to set options for all the selected databases at once
(except the alias which should be unique for each individual database).
Connect at startup
With this option on connection to the profile database is automatically established at
the application startup.
New objects' names (Don't change case, Convert to upper case, Convert to lower case)
The option allows you to specify the newly created objects case.
Click the Ready button when done to start working with the selected databases in MS
SQL Maestro.
Instead of manual profile options editing you can copy all the options from the another
existing profile with the Copy profile button.
Login prompt
Use the option to enable MS SQL Maestro to prompt for user name and password every
time you connect to the database.
Connect at startup
With this option on connection to the profile database is automatically established at
the application startup.
New objects' names (Don't change case, Convert to upper case, Convert to lower case)
Use the option to change the case for newly created objects.
You can also change here the font color the profile name is represented at the Explorer
tree.
Below you can find an example of an obligatory script to execute after MS SQL Maestro
will connect to the database. The script writes a connect time to the log table.
The next screen represents the example of an obligatory script to execute before MS
SQL Maestro will disconnect from the database. The script writes a disconnect time to
the log table.
Click the Add button to add a new file and set its properties in the File Editor 206 .
Click the Edit button to modify the selected file, or the Delete button to remove one
(alternatively, you can use the corresponding popup menu items).
Click Next after you have added all the database files. Click Finish to create the
database without setting special properties.
Compatibility Level
Sets the version of SQL Server for the database to be compatible with (60 = SQL Server
6.0, 65 = SQL Server 6.5, 70 = SQL Server 7.0, 80 = SQL Server 2000, 90 = SQL
Server 2005).
Read Only
Users can read data from the database but not modify it.
Ansi Nulls
If checked, all comparisons to a null value evaluate to UNKNOWN. Otherwise, comparisons
of non-UNICODE values to a null value evaluate to TRUE if both values are NULL.
Ansi Warnings
If checked, errors or warnings are issued when conditions such as divide-by-zero occur or
null values appear in aggregate functions.
Recursive Triggers
If checked, recursive firing of AFTER triggers is allowed.
Quoted Identifiers
If checked, double quotation marks can be used to enclose delimited identifiers.
Otherwise, identifiers cannot be in quotation marks and must follow all Transact-SQL
rules for identifiers. Literals can be delimited by either single or double quotation marks.
Null Concat
If checked, the result of a concatenation operation is NULL when either operand is NULL.
Arithmetic Abort
If checked, a query is ended when an overflow or divide-by-zero error occurs during query
execution. Otherwise, a warning message is displayed when one of these errors occurs,
but the query, batch, or transaction continues to process as if no error occurred.
Auto Close
If checked, the database is shut down cleanly and its resources are set free after the
Auto Shrink
If checked, the database files are automatically shrunk during periodic checks for unused
space.
To open the editor, use popup menu of the database node at the Explorer tree.
Subitems
Every tab is intended for managing corresponding database objects (e.g. tables, views,
queries, etc.). Open the object in its editor by double-clicking or pressing the Enter
key. The popup menu allows you to create new, edit or drop the selected database
objects. Using this menu you can also create a copy of the object.
You can operate on several objects at a time. For this you have to select database
objects with the Shift or the Ctrl key pressed. After the group of objects is selected,
you can operate on it, e.g. delete several objects at once, as it was a single object.
The Properties tab displays available database parameters. Below you can find some of
their descriptions.
Comment
This field stores a comment to the database.
Created
Displays the date when the database was created.
Collation
Specifies the default collation for the database. Collation name can be either a Windows
collation name or a SQL collation name.
Compatibility Level
Sets the version of SQL Server for the database to be compatible with (60 = SQL Server
6.0, 65 = SQL Server 6.5, 70 = SQL Server 7.0, 80 = SQL Server 2000, 90 = SQL
Server 2005).
Read Only
Users can only read data from the database but not modify it.
Ansi Nulls
If checked, all comparisons to a null value evaluate to UNKNOWN. Otherwise,
comparisons of non-UNICODE values to a null value evaluate to TRUE if both values are
NULL.
Ansi Padding
If checked, strings are padded to the same length before conversion or inserting to a
varchar or nvarchar data type.
Ansi Warnings
If checked, errors or warnings are issued when conditions such as divide-by-zero occur
or null values appear in aggregate functions.
Recursive Triggers
If checked, recursive firing of AFTER triggers is allowed.
Quoted Identifiers
If checked, double quotation marks can be used to enclose delimited identifiers.
Otherwise, identifiers cannot be in quotation marks and must follow all Transact-SQL
rules for identifiers. Literals can be delimited by either single or double quotation marks.
Null Concat
If checked, the result of a concatenation operation is NULL when either operand is NULL.
Arithmetic Abort
If checked, a query is ended when an overflow or divide-by-zero error occurs during
query execution. Otherwise, a warning message is displayed when one of these errors
occurs, but the query, batch, or transaction continues to process as if no error
occurred.
Auto Close
If checked, the database is shut down cleanly and its resources are set free after the
last user exits.
Auto Shrink
If checked, the database files are automatically shrunk during periodic checks for unused
space.
The options to create or edit an object in MS SQL Maestro follow the parameters defined
by Microsoft SQL. If you need clarification on what an option means or how it should be
used, see Microsoft SQL's documentation for more information. The documentation
provides detailed description of objects, including their purpose, properties, and
restrictions. The MS SQL Maestro manual provides you with only brief review of
Microsoft SQL objects.
There are several ways to invoke the necessary Create Object Wizard:
· On the first wizard step 45 you need to specify the new object name.
· On the second one you have to define all the object properties. To clear up the
object properties meanings see the appropriate topic of the respective Create
Object Wizard section.
· Some objects has subitems (e.g. each table contains fields, indexes, procedures
have parameters, etc). In this case the next step allows you to manage such
subobjects of the object being created. We recommend you to store the following
shortcuts in order to speed your work: the Ins key adds a new subobject, the
Enter key displays the subobject's editor, and the Del key drops the subobject.
· The next wizard step 46 is final. It is provided to sum up the Create Object Wizard
operation.
Note: There are some objects to have an additional Create Object Wizard
steps. The detailed description of the steps you can find at the
appropriate topic of the corresponding section.
See also:
· Create Schema Wizard 70
· Create Table Wizard 76
· Create View Wizard 107
· Create UDF Wizard 127
· Create UDT Wizard 135
· Create Aggregate Wizard 191
· Creation of a New Query 309
· Create User Wizard 199
· Create Role Wizard 203
· Create File Wizard 206
· Create File Group Wizard 209
· Create Assembly Wizard 213
· Create Symmetric Key Wizard 221
· Create Asymmetric Key Wizard 217
· Create Certificate Wizard 224
· Create Procedure Wizard 117
· Create Synonym Wizard 140
· Create Rule Wizard 144
· Create Default Wizard 149
· Create CLR Procedure Wizard 155
· Create CLR UDF Wizard 160
· Create CLR UDT Wizard 165
· Create Xml Schema Collection Wizard 168
Select the container (table, schema, database, etc.) for the new object from the list of
available containers and enter the new object name in the respective box.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
At this step common information about the object to be created is displayed. Select the
Open object editor after creating option to open the appropriate Object Editor after the
new object is created. Click the Ready button to complete creation of the object.
To open an Object Editor 47 , just double click its node in the Database Explorer tree. Of
course this action is also available through popup menus, navigation bars, and so on.
The editors consist of a several tabs. Some tabs are similar for all editors. This part
purpose is to formulate the basic principles of all Object Editors in MS SQL Maestro.
· To edit object options such as name, owner, etc. use the Properties tab. To
understand an option, see the appropriate topic of the corresponding Object Editor
manual section and Microsoft SQL documentation.
This tab also allows you to manage objects belonging to the selected one. To reset
any tab to default settings, open it when holding the Ctrl key.
· In a similar manner, some objects called grantees (e.g. users or roles) can have
rights to do something with other objects (e.g. a user can read data from a table).
This relationship can be set up at the Grants 49 tab.
· There is a Result tab in editors of such routines as functions and procedures that
can take parameters, perform calculations or other actions, and return a result.
You can execute 52 any routine directly from its editor.
Note: Some object editors have additional tabs. The detailed description of
them you can find at the appropriate topic of the corresponding
section.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
See also:
· Schema Editor 72
· Table Editor 78
· View Editor 112
· UDF Editor 130
· UDT Editor 137
· Aggregate Editor 192
· User Editor 200
· Role Editor 204
· File Editor 206
· File Group Editor 210
· Assembly Editor 214
· Symmetric Key Editor 221
· Asymmetric Key Editor 218
· Certificate Editor 225
· Procedure Editor 121
· Synonym Editor 141
· Rule Editor 145
· Default Editor 150
· CLR Procedure Editor 156
· CLR UDF Editor 161
· CLR UDT Editor 165
· Xml Schema Collection Editor 169
The Permissions grid allows you to manage access privileges (grants) of users and
database roles.
Grants give specific privileges for an object ( schemas, tables, views, procedures, UDFs,
UDTs, XML schema collections, users, roles, assemblies, etc.) to one or more users.
Using the grid you can grant/revoke privileges as well as sort and filter displayed
grantees.
The Grants grid allows you to manage access privileges (grants) of the current object.
A grant gives specific privileges on an object (table, view, procedure) to the current
one.
All objects are grouped by kind. Filter the object kinds using the checkboxes at the
bottom of the window. Using the grid you may sort and filter data.
To grant the subject privilege on the object double-click an empty field; to revoke the
privilege double-click a grant with grant option.
Use grid’s popup menu to grant, grant all, grant with grant option, grant all with grant
option, grant on all, grant on all with grant option, revoke, revoke all and revoke on all:
· select the Grant item to grant the subject privilege on the object;
· select the Grant All item to grant all the privileges on the object;
· if the Grant With Grant Option item is selected, the recipient of the privilege may in
turn grant it to others (without a grant option specified, the recipient cannot do
that; at present, grant options can only be granted to individual subject, not to
groups or Public);
· select the Grant All With Grant Option item to grant with grant options the privilege
on all the objects of the kind;
· select Grant On All or Grant On All With Grant Option to grant or grant with grant
options respectively the subject privilege on all the objects;
· select Deny item to deny the subject privilege on the object;
· select Deny All item to deny all the privileges on the object;
· use Deny on All to deny the subject privilege on all the objects;
· to revoke the privilege, all the privileges on the object or the privileges on all the
server objects select the Revoke, Revoke All or Revoke On All items respectively.
Using the popup menu you can also collapse or expand all the object kinds.
4.2.1.3 Object Dependencies
When you create complex database structures involving many tables with foreign key
constraints, views, triggers, UDFs, etc. you will implicitly create a net of dependencies
between the objects. For instance, a table with a foreign key constraint depends on the
table it references. We tried to create a software to make your work easier, i.e. to give
you the tools for efficient database objects management. The Dependencies tab allows
you to control the correlation of objects efficiently.
The Depends on window represents all the objects the current object depends on.
The Referenced by window contains the tree of database objects constituting the
dependency relationship on the current object.
Use items of the popup menu to edit the selected object in Object Editor or to drop the
object.
The SQL tab displays the SQL definition for the object with all its properties. Bear in mind
that this text is read-only. If you want to change the object definition, use the
appropriate editor tabs instead, or copy the text to the Windows Clipboard to paste it in
SQL Editor or SQL Script Editor.
The SQL definition window allows you to browse the text effectively. The popup menu
and the extensive system of hot keys give you the opportunity to search expressions
within the text, to select the whole text for copying it to the Windows Clipboard, to
save the definition to the *.sql or *.txt files, to print the document, etc.
You can customize the displayed definition using the Editors & Viewers 445 options.
The Properties item of the popup menu displays the Options dialog in which you can
establish optional settings concerning the current database.
The Code Folding item group makes it possible to view either the whole text or its logical
parts (regions). Each region can be collapsed and extended.
In collapsed mode the text is hidden behind one text line denoting the first line of the
collapsed region.
Navigation Bar on the SQL tab allows you to copy the object’s SQL definition (DDL) to
the SQL Script Editor for future modifications.
The editor allows you to change the Parameter name, Data type and the Default value
that specifies a parameter value to be used when no value is explicitly supplied.
Microsoft SQL supports the scope function parameters (Input is the default value).
Use the Size edit box to define the length of the parameter value for float, char and
other data types and the Precision edit box to define the precision of the parameter
value, e.g. for decimal data type.
If the procedure/UDF/CLR UDF has parameters, MS SQL Maestro will ask you to specify
the values for these parameters in the Input parameters dialog which appears before the
procedure execution. Input parameters dialog allows you to specify the values for all
input parameters. After changes are made, click the OK button to execute the UDF, or
the Cancel button to abort the execution.
MS SQL Maestro supports Parameter History. Values that have been set previously as
the routine parameters are represented in the History tab of the Input Parameter dialog
with a date and time of their last using. Double click a necessary set of values to set
them as the routine parameters. You can manage the Parameter History with Delete
history item and Clear history links.
The result of the successfully executed routine can be found within the Results tab of
Procedure/UDF/CLR UDF Editor.
Note: If any unsaved changes are applied to the routine being currently edited, the
execution of the routine is impossible until changes are saved by the Compile
procedure item of the Navigation Bar.
MS SQL Maestro also supports extended properties. In using extended properties, you
can add text, such as descriptive or instructional content, add input masks, and add
formatting rules as properties of objects in a database or of the database itself. For
example, you can add an extended property to a schema, a schema's view, or to a
column in the view. Because extended properties are stored in the database, all
applications reading the properties can evaluate the object in the same way. This helps
enforce consistency in the way data is treated by all the programs in the system.
MS SQL Maestro allows you to add/edit/drop such properties for tables, views,
procedures, columns, indexes, etc. Each extended property has a user-defined name
and value. The value of an extended property can contain up to 7,500 bytes of data.
Multiple extended properties can be added to a single object.
Step-by-step:
1. Duplicate Object Wizard. The wizard is the most flexible tool of the coping. Along
with a possibility to adjust the new object definition it allows you to copy data (for
tables). But it consists of several steps 55 and takes more time than other manners.
2. Duplicate Object window allows you to attune new object's SQL definition. It is
preferred for creation a copy of selected object. Here 57 you can find some additional
info.
3. By Drag-n-Drop 58 operation.
To run the wizard select the Object | Duplicate Database Object... main menu item.
Select the database containing a source object from the list of connected databases,
and then specify the database for the duplicated object.
You should connect to the destination database beforehand (see Database Management
22 ).
Specify a database object to create the new one with the same properties.
1. Select the type of the object to duplicate from the Source objects drop-down list.
The last wizard step allows you to edit the new object definition directly.
Use this step to edit the name of object been creating (New Object Name). By default
MS SQL Maestro generates the new object definition with the same name if the
duplicating is to the source database, or like "%SOURCE_OBJECT_NAME%01" otherwise.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
You can edit the result SQL statement manually, add or remove fields, change field
types, using the New object definition text area. Click the Ready button to complete the
operation.
Check the according boxes to Copy Data (only for tables) and to Open Object Editor
after the duplicating.
It is available from the corresponding link of the object's popup menu at the Database
Explorer.
Select the database for a new object from the list of connected databases first.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
You can also edit the SQL definition of the object if necessary (add or remove fields,
change field types, etc.).
To copy an object, just drag the object in a source window (such as Database Explorer,
Object Manager, Object Browser) and drop it to the target container in another window.
You also can use the Edit | Copy and the Edit | Paste main menu items or the Ctrl+C/
Ctrl+V hot keys combinations respectively. Copying several objects at a time is also
available.
It is also possible to drag and drop objects between Database Explorer, Object Manager,
Object Browser and SQL Editor or SQL Script Editor. This works as follows:
SQL Editor: after dropping the object you will get a query to retrieve object data (e.g.
SELECT * FROM table_name) or the full name of the object if it doesn't contain data
(domains, indexes, etc.).
SQL Script Editor: after dropping the object you will get its SQL definition if applicable.
All tool allows you to drag-and-drop between them and to perform all necessary
operations upon database objects.
To start working with a database you need to create its profile first. The conception of
database profiles gives you an opportunity to connect to databases in one touch and
work with the selected databases only.
Note: In case your databases have a large quantity of objects you can speed up the
object search by typing first letters of the object name in the explorer area.
Note: Explorer options 428 allow you to hide/display table subobjects, represent system
objects in different color, etc.
· What operation can I accomplish upon database profiles within the Explorer Tree? 62
In addition to these operations, Database Explorer gives you an ability to reorder existing
profiles by performing drag-and-drop operations within the explorer tree.
and the destination databases first. After the connection is established, simply drag and
drop an object to copy from the source database to the corresponding node (Tables,
Queries, etc.) of the destination database.
Note: You also can use the Edit | Copy and the Edit | Paste main menu items
to copy/paste a database object using Windows clipboard
(alternatively, you may use the Ctrl+C/Ctrl+V hot keys combinations
respectively).
To drop an existing database using Database Explorer, connect to the database you wish
to drop, select the Drop Database item from the popup menu of the database and confirm
dropping in the dialog window.
Note: Alternatively, you can use the Database | Create New (Drop) Database
main menu item to perform these operations.
MS SQL Maestro allows you to reduce the number of represented objects in the explorer
tree. To hide seldom usable objects, filter your explorer content.
Filter Panel is available through the View | Show Filter Panel main menu item.
· Specify the Filter expression. The expression can contain any part of object name
combined with an asterisk ('*') as a wildcard character and a question-mark ('?') as
a mask character.
· Define the Filtered objects, object types for filtering in the explorer tree.
· Check the according radio button (Show by expression, Hide by expression) to define
whether database objects will be shown or hidden in accordance with the filter
expression.
As Object Manager the browser allows you to operate on several objects at a time. You
have an opportunity to select a batch of objects and after the object group is selected,
you can operate on it (e.g. drop several objects at once) as if it were a single object.
· use the drop-down button in the column caption area to filter objects by the value
of the selected column
· click the drop-down button in the column caption area, then select the Custom
item and build a simple filter within the dialog in the following way: select a logical
operator for checking the column values (like is less than, is greater than, etc) and
set the value to be checked by this operator in the neighboring box; then set the
second condition if necessary in the following way and set the relation between
these two conditions, whether both of them should be matched or just one of
them; use the '_' character to represent any single symbol in the condition and the
'%' character to represent any series of symbols in the condition
After you set a filter, the filtering panel becomes visible at the bottom of the grid where
you can see the active filtering condition and easily enable or disable it by clicking the
check box on the left. Using this panel you can also customize your filter in a more
complicated way by clicking the Customize button and building your filter within the
Filter Builder dialog.
following example.
5 Database Objects
The following list contains database objects supported by MS SQL Maestro. To work
with database objects you should connect to the database 13 first.
· Schemas 69
· Tables 75
· Views 106
· UDFs 126
· UDTs 134
· Aggregates 190
· Users 199
· Roles 202
· Files 206
· File Groups 209
· Assemblies 212
· Symmetric Keys 220
· Asymmetric Keys 216
· Certificates 223
· Procedures 116
· Synonyms 139
· Rules 143
· Defaults 148
· CLR Procedures 154
· CLR UDFs 159
· CLR UDTs 164
· Xml Schema Collections 167
· Queues 171
· Message Types 177
· Contracts 180
· Services 183
· Conversations 186
5.1 Schemas
Schemas are a purely logical structure and the privilege system determines whether one
can access them. A database is a collection of schemas and the schemas contain tables,
views, UDFs, etc. The full hierarchy is: server, database, schema, table (or some other
kind of object, such as a UDF). Schemas are being implemented in Microsoft Server 2005.
· select the schema for editing in the explorer tree (type the first
letters of the schema name for quick search);
· select the Edit Schema... item from the popup menu
or
· open the database in Database Editor and the Schemas tab
there;
· select the schema to edit;
· press the Enter key or select the Edit Schema item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
To drop a schema:
Schema options
Owner
Use the field to specify the owner of the new schema. The default owner is the user
who have created the schema. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
The box allows you to set optional text describing the new schema.
· Open the corresponding tab (Tables - to manage schema tables, Views - to manage
schema views, and so on);
· Use the Create Object Wizard link of the tab's pop-up menu or press Insert;
· Complete the corresponding create object wizard. To find out the wizards description,
read the corresponding topics:
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The Properties tab allows you to view schema options and to browse schema content
divided into groups according to their types (tables, views, functions, etc.). The popup
menu of each tab allows you to create new, edit, copy or drop the appropriate schema
object. The grid allows you to operate with several objects at a time. For this purpose
select objects with the Shift or the Ctrl key pressed. After a group of objects is
selected you can operate with them, e.g. delete several objects at once, as if it is a
single object.
Name
Here you can view the schema name.
Owner
This field allows you to modify the schema owner. By default, only the owner of an
object can perform various operations with the object. In order to allow other users to
operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)Microsoft SQL denies to change owners of
system schemas.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.2 Tables
MS SQL Maestro allows you to manipulate tables with easy: add new tables to the
database, modify existing ones, browse table options and data. The sections below
describe each of these actions in detail.
Tables can be edited within Table Editor 78 . In order to run the editor
you should either
· select the table for editing in the explorer tree (type the first
letters of the table name for quick search);
· select the Edit Table... item from the popup menu
or
· open Schema (Database) Editor and the Tables tab there;
· select the table to edit;
· press the Enter key or select the Edit Table item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can also view and edit table properties without launching Table
Editor:
· select the table for editing in the explorer tree (type the first
letters of the table name for quick search);
· select the Table Properties... item from the popup menu;
· edit table properties within the Table Properties dialog.
You can change the name of the table using the Rename Table
dialog. To open the dialog you should either
To drop a table:
Table Editor allows you to work with table data including master-detail views 80 ,
generate simple SQL statements 406 , CRUD procedures 407 to work with this table, and
split the table 410 into two separate tables.
Table options (All fields at this wizard step are optional, i.e. it is not obligatory for you
to fill them.)
The field Name contains the name of the table being created as it was set on the
previous step.
Owner
You can specify here the name of the Microsoft SQL server user that will own the new
table, or leave this field blank to use the default user (namely, the user executing the
command). By default, only the owner of an object can perform various operations with
the object. In order to allow other users to operate it, privileges must be granted.
(However, users that have the superuser attribute can always access any object.)
Comment
Set the optional text to describe the new table.
File Group
Put the file group 209 name to associate with the new table, or leave this field blank to
use the template table file group. This file group will be the default one used for objects
created in this table. The default file group is based on the template table file group.
Define the Text and Image File Group keywords to indicate that the text, ntext, image,
xml, varchar(max), nvarchar(max), varbinary(max), and CLR user-defined type columns
are stored on the specified file group or leave this field blank to use the default file
group.
Note: The text and image file group is not allowed if there are no large value
columns in the table.
· Choose the necessary page (Fields - to add table fields, Indexes - table indexes, and
so on);
· Follow the corresponding link of the tab's pop-up menu;
· Specify properties of the new object. To find the description of field 82 , foreign key
89 , check 91 , trigger 97 , default constraint 93 , and index 86 , follow the according
link.
The popup menu of each tab allows to edit, drop, reorder, and rename specified objects,
etc.
Click Add All or Add to include table(s) to table definition. Use the Remove or Remove All
items to exclude table(s) from the list.
The Properties section allows you to view general table properties and also to modify the
table name, the table owner, and a comment for the table.
Subitems
Every tab is intended for work with defined objects (fields, indexes, etc.). To modify any
object, double click it or use grid’s popup menu. The menu also allows you to add new,
rename, describe, copy/paste, and drop selected objects. To operate with several
objects at a time, select them with the Shift or the Ctrl key pressed. After a group of
objects is selected you can operate with it, e.g. delete several objects at once, as if it
is a single object.
Owner
You can view and modify the name of the table Owner.
By default, only the owner of an object can perform various operations with the object.
In order to allow other users to operate it, privileges must be granted. (However, users
that have the superuser attribute can always access any object.)
Comment
This field contains a comment to the table.
Create Date
Displays the date when the table was created.
Modify Date
Displays the date when the table was last modified.
File Group
Represents the file group on which the table is stored.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
The Data tab displays the table data as a grid or as info cards (see Data View 326 for
details). To edit/add a table record, use Data Input Form or type the new data directly
in the grid (card). To export/import/get SQL dump of the table data, invoke
corresponding modules from the grid's popup menu. To view and edit the content of
BLOB columns, run BLOB Editor 337 .
Lookup editors
Lookup editor displays the content of parent table’s columns within the drop-down
window. MS SQL Maestro enables a lookup editor for a column linked by a foreign key
with a single column from another table. To get the corresponding data, double click the
field or use F2 shortcut and press Alt+Down Arrow Key.
newlines and the first line of the data block contains column headers.
Example:
ColHeader1 ColHeader2
R1C1 R1C2
R2C1 R2C2
The same data format is supported by a lot of other applications, so the ability allows
you to copy data from MS Excel, another table or view, or even from a data set from a
different DBMS especially if it is opened with an appropriate our product.
Example:
Suppose we have a table 'employee' with Non-Blob data as follows:
Id User
1 Max
2 July
And we need to import the 1.jpg and 2.jpg files to a BLOB column of the table. The files
are stored in the "D:\Images" directory. In this case we need to specify the "D:\Images\
%Id%.jpg" file name template.
5.2.3 Fields
Table columns are created and edited within the Field Editor.
· open the table in Table Editor and the Fields tab there;
· press the Insert key or select the Add New Field... item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
Field popup menu item
or
· select the table Fields node or any field within the table in the
explorer tree and use the Add New Field... popup menu item.
Table fields are edited within the Field Editor 82 dialog window. In
order to open the dialog you should either
· open the table in Table Editor and the Fields tab there;
· press the Enter key or select the Edit Field item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar)
or
· select the field to edit in the explorer tree and use the Edit Field
popup menu item.
You can change the name of the field using the Rename Field dialog.
To open the dialog you should either
Note: the name of the object must be unique among all the object names in
the table. You can use any identifier that is allowed by Microsoft SQL
server.
Content|Document
Denotes that each instance of the xml data type can contain multiple top-level elements
(for Content) or only one top-level element (for Document).
Parameters
Use the Size edit box to define the length of the field value for integer, float, char and
other data types and use Precision to define the precision of the field value, e.g. for
The max value applies only to the varchar, nvarchar, and varbinary data types for
storing 2^31 bytes of character and binary data, and 2^30 bytes of Unicode data.
Field flags
Not Null
Forbids the NULL values for the field.
Unique
Includes the field into the unique key (index).
Primary Key
With this option checked the field becomes the only field with a primary key. If you
check this field, you will not be able to set this attribute for any other field in the table.
Hence if you want to create a compound primary key, do not check this field but create
a primary key through the Indexes tab of Table Editor 78 or the appropriate step of
Create Table Wizard 76 .
Row Guid
Indicates that the new column is a row GUID column.
Formula
Represents an expression that defines the value of a computed column. A computed
column is a virtual column that is not physically stored in the table unless the column is
checked Persisted.
Rule
Binds the rule to a column data type. The rule is to be created in the database
beforehand.
Default value
Within the box you can assign a default value for the field column. The action is
optional. If the default value was specified during the new row created and no values is
specified for some of the columns, the columns will be filled with their respective default
values.
The Comment box allows you to set optional text describing the field.
Check the Identity option to indicate that the new column is an identity column.
Seed
Defines the value used for the very first row loaded into the table.
Increment
Defines the incremental value added to the identity value of the previous row loaded.
5.2.4 Indexes
Indexes are primarily used to enhance database performance (though inappropriate use
may result in slower performance). The key field(s) for the index are specified as column
names. Multiple fields can be specified if the index method supports multicolumn indexes.
· open the table in Table Editor and the Indexes tab there;
· press the Insert key or select the Add New Index... item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
Index popup menu item
or
· select the table Indexes node or any index within the table in
the explorer tree and use the Add New Index... popup menu
item.
· open the table in Table Editor and the Indexes tab there;
· press the Enter key or select the Edit Index item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar)
or
· select the index to edit in the explorer tree and use the Edit
Index popup menu item.
You can change the name of the index using the Rename Index
dialog. To open the dialog you should either
Use the Columns drop-down list to select a key field(s) for the index.
Unique Index
If checked, creates a unique index for the table, i.e. the database system ensures that
no two rows of the specified table have the same values in the indexed columns. In this
way, if two rows both contain the NULL value for all columns of an index, the two index
values are not considered to be identical. If at least one column does not contain the
NULL value, two rows that have the same value in all non-NULL columns are considered
to be identical.
Constraint
Creates an index on a specified table as a table constraint.
Index
Creates an index on a specified table as database object.
Index Filegroup
If a Filegroup is specified the index is stored in the named filegroup.
Fill Factor
Specifies the percentage that indicates how full the Database Engine should make the
leaf level of each index page during index creation or change.
Pad Index
Specifies index padding. If checked, the percentage of free space portioned by Fill
Factor is applied to the intermediate-level pages of the index.
Secondary Type
Specifies the type of secondary XML index.
Create as CLUSTERED
If checked, creates an index in which the logical order of the key values determines the
physical order of the corresponding rows in a table.
Primary
Defines primary key.
Sort in TempDB
Specifies whether to store sort results in a TempDB. If checked, the intermediate sort
results that are used to build the index are stored in a TempDB.Fill factor
Use the parameter to determine how full the index method will try to pack index pages.
For B-trees, leaf pages are filled to this percentage during initial index build, and also
when extending the index at the right (largest key values). If pages subsequently
become completely full, they will be split, leading to gradual degradation in the index's
efficiency. B-trees use a default fill factor of 90, but any value from 10 to 100 can be
selected. If the table is static then fill factor 100 is best to minimize the index's physical
size, but for heavily updated tables a smaller fill factor is better to minimize the need for
page splits. The other index methods use fillfactor in different but roughly analogous
Note: To create a foreign key constraint, it is necessary to have this privilege for both
the referencing and referenced tables.
Foreign keys are created within the Foreign Key Properties 89 dialog
window. In order to open the dialog you should either
· open the table in Table Editor and the Foreign Keys tab there;
· press the Insert key or select the Add New Foreign Key... item
from the popup menu (alternatively, you may use the
corresponding link of the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
Foreign Key popup menu item
or
· select the table Foreign Keys node or any foreign key within the
table in the explorer tree and use the Add New Foreign Key...
popup menu item.
Foreign Keys are edited within the Foreign Key Properties 89 dialog
window. In order to open the dialog you should either
· open the table in Table Editor and the Foreign Keys tab there;
· press the Enter key or select the Edit Foreign Key item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar)
or
· select the foreign key to edit in the explorer tree and use the
Edit Foreign Key popup menu item.
You can change the name of the foreign key using the Rename
Foreign Key dialog. To open the dialog you should either
Set the Foreign Key Name, select Columns from the Available Fields list to include into
the foreign key, select the Foreign Table Name from the drop-down list and its fields
from the list to include, set other foreign key properties and apply the changes by
clicking the OK button.
All the fields which are included into the Foreign Key must be included into indexes as
well. See Indexes 86 for details.
Comment
The box allows you to set optional text describing the foreign key.
Disabled
When checked, disables foreign key.
Set rules ON DELETE and ON UPDATE from the respective drop-down lists.
· NO ACTION Produce an error indicating that the deletion or update will create a
foreign key constraint violation. If the constraint is deferred this error will be
produced at constraint check time if there still exist any referencing rows. This is
the default action.
· CASCADE Delete any rows referencing the deleted row, or update the value of the
referencing column to the new value of the referenced column, respectively.
5.2.6 Checks
A check constraint is the most generic constraint type. It allows you to specify that the
value in a certain column must satisfy a Boolean (truth-value) expression.
Check Properties allows you to add a new check constraint or edit an existing one. It is
available from Table Editor 78 , or from the corresponding nodes of the explorer tree.
· open the table in Table Editor and the Checks tab there;
· press the Insert key or select the Add New Check... item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
Check... popup menu item
or
· select the table Checks node or any check within the table in
the explorer tree and use the Add New Check... popup menu
item.
You can change the name of the check using the Rename Check
dialog. To open the dialog you should either
Name
Here you can set and edit the check name.
Comment
This field contains an optional text describing the check.Condition
Specify an expression producing a Boolean result which new or updated rows must
satisfy for an insert or update operation to succeed. Expressions evaluating to True or
Unknown succeed. In case any row of an insert or update operation produce a FALSE
result an error exception is raised and the insert or update does not alter the database.
Disabled
If the option is selected, the check is disabled.
· open the table in Table Editor and the Default Constraints tab
there;
· press the Insert key or select the Add Default Constraint... item
from the popup menu (alternatively, you may use the
corresponding link of the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
Default Constraint popup menu item
or
· select the table Default Constraints node or any default
constraint within the table in the explorer tree and use the Add
New Default Constraint... popup menu item.
· open the table in Table Editor and the Default Constraints tab
there;
· press the Enter key or select the Edit Default Constraint item
from the popup menu (alternatively, you may use the
corresponding link of the Navigation Bar)
or
· select the default constraint to edit in the explorer tree and use
the Edit Default Constraint popup menu item.
You can change the name of the default constraint using the Rename
Default Constraint dialog. To open the dialog you should either
allows you to add a new default constraint or edit an existing one. It is available from
Table Editor 78 , or from the corresponding nodes of the explorer tree.
The Default Constraint Properties window allows you to set the constraint name, enter
some optional text describing it, select a field to define the default constraint on, and
also to specify the default value.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
5.2.8 Triggers
· open the table in Table Editor and the Triggers tab there;
· press the Insert key or select the Add New Trigger... item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
Trigger... popup menu item
or
· select the table Triggers node or any trigger within the table in
the explorer tree and use the Add New Trigger... popup menu
item.
· open the table in Table Editor and the Triggers tab there;
· press the Enter key or select the Edit Trigger item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar)
or
· select the trigger to edit in the explorer tree and use the Edit
Trigger popup menu item.
You can change the name of the trigger using the Rename Trigger
dialog. To open the dialog you should either
Create Trigger Wizard guides you through the process of creating of a new table trigger.
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Comment
This field contains a comment to the table trigger.
Execute As
Specifies the security context under which the trigger is executed.
Events
One of Insert, Update, or Delete; this specifies the event that will fire the trigger.
Enabled
If checked, the trigger is enabled.
Trigger Editor can be opened automatically after the trigger is created and is available
on editing the trigger.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The main tab of the editor consists of several parts:, trigger definition, and trigger
properties.
Definition
Defines the trigger conditions and actions.
Properties
Name
Here you can view and change the trigger name.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
Comment
This field contains a comment to the trigger.
Create Date
Displays the date when the trigger was created.
Modify Date
Displays the date when the trigger was last modified.
Encrypted
If checked, it prevents the trigger from being published as part of SQL Server replication.
Type
Specifies the trigger type.
After: the trigger is fired only after all operations specified in the triggering SQL
statement have executed successfully.
Instead Of: the trigger is executed instead of the triggering SQL statement, therefore,
overriding the actions of the triggering statements.
Events
One of Insert, Update, or Delete; this specifies the event that will fire the trigger.
Enabled
If checked, the trigger is enabled.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Table CLR Triggers are managed within the CLR triggers tab of Table Editor.
CLR triggers are created within Create CLR Trigger Wizard 101 . In
order to run the wizard you should either
· open the table in Table Editor and the CLR Triggers tab there;
· press the Insert key or select the Add CLR New Trigger... item
from the popup menu (alternatively, you may use the
corresponding link of the Navigation Bar)
or
· select the table in the explorer tree and use the Create New
CLR Trigger... popup menu item
or
· select the table CLR Triggers node or any trigger within the
table in the explorer tree and use the Add New CLR Trigger...
CLR triggers are edited within the CLR Trigger Editor dialog window.
In order to open the dialog you should either
· open the table in Table Editor and the CLR Triggers tab there;
· press the Enter key or select the Edit CLR Trigger item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar)
or
· select the trigger to edit in the explorer tree and use the Edit
CLR Trigger popup menu item.
Create CLR Trigger Wizard guides you through the process of creating a new CLR trigger.
See How To Create CLR trigger 100 for instructions on running this wizard.
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Specify CLR trigger options according to your needs. The detailed description is given
below.
Comment
Supply a comment for the new CLR trigger.
Execute As
Specifies the security context under which the CLR trigger is to be executed.
Type
Defines the type of the CLR trigger. Possible values are After (specifies that the trigger
is fired only when all operations specified in the triggering SQL statement have been
executed successfully) and Instead of (specifies that the trigger is executed instead of
the triggering SQL statement, therefore, overriding the actions of the triggering
statements).
Events
Specifies the data modification statements that activate the trigger when it is tried
against this table or view. At least one option must be specified. Any combination of
these options in any order is allowed in the trigger definition.
Enabled
If checked, it is denoted that a trigger action takes effect when fired.
CLR Trigger Editor allows you to edit CLR Trigger definition (CLR trigger name, CLR trigger
comment, etc.). It opens when you create a new CLR trigger or edit the existing one
(see How to edit CLR trigger 100 for details).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify CLR trigger options according to your needs. The detailed description is given
below.
Name
You can edit the CLR trigger name here.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
Comment
You can supply a comment for the CLR trigger.
Create Date
Displays the date when the CLR trigger was created.
Modify Date
Displays the date when the CLR trigger was last modified.
Execute As
Specifies the security context under which the CLR trigger is to be executed.
Type
Defines the type of the CLR trigger. Possible values are After (specifies that the trigger
is only fired after all operations specified in the triggering SQL statement have executed
successfully) and Instead of (specifies that the trigger is executed instead of the
triggering SQL statement, therefore, overriding the actions of the triggering
statements).
Events
Specifies the data modification statements that activate the trigger when it is tried
against this table or view. At least one option must be specified. Any combination of
these options in any order is allowed in the trigger definition.
Enabled
If checked, it is denoted that a trigger action takes effect when fired.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
These are only references to foreign keys. They are designed specially for easy foreign
keys management.
Table foreign key references are edited within the Foreign Key Editor
89 dialog window. In order to open the dialog you should either
Table foreign key references are edited within the Foreign Key Editor
89 dialog window. In order to open the dialog you should either
5.3 Views
Views are useful for allowing users to access a set of relations (tables) as if it were a
single table, and limiting their access to just that. Views can also be used to restrict
access to rows (a subset of a particular table).
New views are created within Create View Wizard 107 . In order to run
the wizard you should either
To create a new view with the same properties as one of the existing
views has:
Views can be edited within View Editor 112 . In order to run the editor
you should either
· select the view for editing in the explorer tree (type the first
letters of the view name for quick search);
· select the Edit View... item from the popup menu
or
· open Schema (Database) Editor and the Views tab there;
· select the view to edit;
· press the Enter key or select the Edit View item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can change the name of the view using the Rename View dialog.
To open the dialog you should either
To drop a view:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Owner
Defines the owner of the new view. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
The box allows you to set optional text describing the view.
Schema Binding
Binds the view to the schema of the underlying table (or tables). If checked, the base
table (or tables) cannot be modified in a way that would affect the view definition. All
the referenced objects must be in the same database.
Suppose we need to select orders from the sample table Orders made between
01.02.2010 and 10.02.2010. These criteria are applied to the OrderDate column.
Press the button to add this condition. Alternatively, you can use the Filter button
and select the Add Condition option from the drop-down menu.
Select the OrderDate column in the drop-down list of the available columns.
Next, you need to specify the range values for the selected operator. The editor
used in value boxes is determined by the editor type assigned to the corresponding
column.
You can add additional conditions to the same root level to be combined by the
AND operator.
Suppose we need to select orders made between 01.02.2010 and 10.02.2010 and
payed via 'Visa' or 'American Express'. This is a complex filter condition combining
two simple conditions with the OR operator. Conditions from the same root level are
combined by the AND operator. To add a condition combined with the previous one
with the OR (NOT AND, NOT OR) operator, use a new group of conditions.
The next screen represents the finished filter conditions for this example.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
View Editor provides you with an ability to edit view properties. The Properties tab
allows you to change the view name, view definition, the view owner and the comment
for the view.
Subitems
Every tab is intended for managing some view subitems (e.g. fields, indexes, triggers,
and CLR triggers). Each object can be opened in its editor. Use grid’s popup menu to
create new, edit or drop the selected view subitems. Using the popup menu you can
also copy the selected objects to clipboard or paste previously copied objects.
You can operate on several objects at a time. For this you have to select view objects
with the Shift or the Ctrl key pressed. After a group of objects is selected you can
operate on it, e.g. delete several objects at once, as if it were a single object.
Body
You can edit the view definition in this box.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
Owner
Represents the view owner. By default, only the owner of an object can perform various
operations with the object. In order to allow other users to operate it, privileges must be
granted. (However, users that have the superuser attribute can always access any
object.)
Comment
This field stores a comment to the view.
Create Date
Displays the date when the view was created.
Modify Date
Displays the date when the view was last modified.
Encrypted
If checked, the view is prevented from being published as part of SQL Server replication.
Schema Binding
Binds the view to the schema of the underlying table or tables. If checked, the base
table or tables cannot be modified in a way that would affect the view definition. All
referenced objects must be in the same database.
checked, the browse-mode metadata returns the view name and not the base table
names when it describes columns from the view in the result set.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.3.2.2 Viewing data
The Data tab displays the data represented in the view as a grid (see Data View for
details). The popup menu of this tab and the Data Management navigation bar allow you
to export data, get SQL dump, set the value of the selected record to Null or to Now
(for Date values). In tables with BLOB fields you can also call BLOB Editor to view and
edit the BLOB fields.
5.4 Procedures
A stored procedure is a saved collection of Transact-SQL statements or a reference to a
Microsoft .NET Framework common language runtime (CLR) method that can take and
return user-supplied parameters. Procedures can be created for permanent use or for
temporary use within a session, local temporary procedure, or for temporary use within
all sessions, global temporary procedure.
· select the procedure for editing in the explorer tree (type the
first letters of the procedure name for quick search);
· select the Edit Procedure... item from the popup menu
or
· open Schema Editor and the Procedures tab there;
· select the procedure to edit;
· press the Enter key or select the Edit Procedure item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the procedure using the Rename
Procedure dialog. To open the dialog you should either
To execute a procedure:
· select the procedure in the explorer tree (type the first letters
of the procedure name for quick search);
· select the Edit Procedure... item from the popup menu;
· execute the procedure using the Execute link of the Navigation
Bar
or
open Schema Editor and the Procedures tab there;
· select the procedure to execute;
· press the Enter key or select the Edit Procedure item from the
popup menu, or use the corresponding link of the Navigation Bar;
· execute the procedure using the Execute link of the Navigation
bar.
To drop a procedure:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying procedure options 118
· Managing parameters of a new procedure 120
· Specifying procedure definition 120
Specify procedure options according to your needs. The detailed description is given
below.
Name
The new procedure name as it was set on the previous step.
Owner
Defines the owner for the procedure. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Comment
Specify a comment for the procedure.
Execute As
Specifies the security context under which to execute the stored procedure (For details
see Execute As Clause (Microsoft SQL 2005 References)).
Check the For Replication option to indicate that the procedure is executed only during
replication.
With Recompile
Indicates that the Database Engine does not cache a plan for this procedure and the
procedure is compiled at run time.
Use the pop-up menu or press Insert to add a new parameter and set its properties in
Parameter Editor 52 . Press Enter or use the appropriate pop-up menu item to edit the
selected parameter, or the Delete to delete one.
At this step you can specify the SQL definition for the new procedure. The step is
optional: you can do it later using a non-modal editor.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing procedure properties 122
· Viewing procedure results 124
The Body contains the definition of the procedure. The Parameters tab contains the list
of the current procedure parameters with its options. Here you can view the Name and
the Type of each parameter of the procedure and supply a Comment for the parameter.
Use grid's popup menu to add, edit parameters in Parameter Editor. It also allows you to
Parameters can be edited within the Parameter Editor dialog window. In order to open
the dialog you should
· open the object in its editor and the Parameters tab there;
· select the parameter to edit;
· press the Enter key or select the Edit Parameter item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
Name
Defines the procedure name.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
Owner
There is the owner for the procedure. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Comment
This field contains a comment to the procedure.
Create Date
Indicates the date when the procedure was created.
Modify Date
Indicates the date when the procedure was last modified.
Check the Encrypted option to indicate that SQL Server will convert the original text of
the CREATE PROCEDURE statement to an obfuscated format. The output of the
obfuscation is not directly visible.
Execute As
Specifies the security context under which to execute the stored procedure (For details
see Execute As Clause (Microsoft SQL 2005 References)).
Check the For Replication to indicate that the procedure is executed only during
replication.
Parameters
Here you can find the list of the procedure parameters.
With Recompile
Indicates that the Database Engine does not cache a plan for this procedure and the
procedure is compiled at run time.
Number
Is an optional integer that is used to group procedures of the same name.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
The Results tab represents the result of the successfully executed procedure, if it
returns a data that is represented as a grid (see Data View for details). Use grid’s popup
menu to export data, get SQL dump. In result with BLOB fields you can also call the
BLOB Editor to view the BLOB fields. The data in result set is always read-only.
5.5 UDFs
A user-defined function (UDF) is stored as a database object providing reusable code that
can be used in Transact-SQL (T-SQL) statements such as SELECT, in applications calling
the function, in the definition of another user-defined function, to parameterize a view or
improve the functionality of an indexed view, to define a column in a table, to define a
CHECK constraint for a column or to replace a stored procedure.
User-defined functions have been expanded in Microsoft SQL Server 2005 to include
functions written in any .NET programming language. SQL Anywhere allows to define user-
specific database functions. In an SQL statement, you can then use these user-defined
database functions in the same way as any other predefined functions.
New UDFs are created within Create UDF Wizard 127 . In order to run
the wizard you should either
To create a new UDF with the same properties as one of the existing
UDFs has:
UDFs can be edited within UDFEditor 130 . In order to open the editor
you should either
· select the UDF for editing in the explorer tree (type the first
letters of the UDF name for quick search);
· select the Edit UDF item from the popup menu
or
· open Schema Editor and the UDFs tab there;
· select the UDF to edit;
· press the Enter key or select the Edit UDF item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can change the name of the UDF using the Rename UDF dialog:
· select the UDF in the explorer tree (type the first letters of the
UDF name for quick search);
· select the Edit UDF... item from the popup menu;
· execute the UDF using the Execute link of the Navigation Bar
or
· open Schema Editor and the UDFs tab there;
· select the UDF to execute;
· press the Enter key or select the Edit UDF item from the popup
menu, or use the corresponding link of the Navigation Bar;
· execute the UDF using the Execute link of the Navigation bar.
To drop a UDF:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Specify the properties for the new UDF according to your needs. The detailed
description is given below.
Owner
Select the owner of the UDF from the drop-down list. By default, only the owner of an
object can perform various operations with the object. In order to allow other users to
operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Comment
Supply a comment to the UDF if necessary.
Defines the data type of the function result.
Language
The field stores the name of the language the function is implemented in. Select either
of the available languages: SQL, C, internal, or the name of a u ser-defined procedural
language. For backward compatibility, the name may be enclosed by single quotes.
Check the Strict option to indicate that the function always returns NULL whenever any
of its arguments are null. If this option is specified, the function is not executed when
there are null arguments; a null result is assumed automatically instead. Uncheck the
Strict option to indicate that the function will be called normally when some of its
arguments are null. It is then the function author's responsibility to check for null values
Execution Privileges
Select Invoker to indicate that the function is to be executed with the privileges of the
user that calls it (the default value).
Select Definer to specify that the function is to be executed with the privileges of the
user that created it.
Stability
Set the attribute to inform the system whether it is safe to replace multiple evaluations
of the function with a single evaluation, for run-time optimization. If none of these
appear, Volatile is the default assumption.
Immutable indicates that the function always returns the same result when given the
same argument values; that is, it does not do database lookups or otherwise use
information not directly present in its argument list. If this option is given, any call of the
function with all-constant arguments can be immediately replaced with the function
value.
Stable indicates that within a single table scan the function will consistently return the
same result for the same argument values, but that its result could change across SQL
statements. This is the appropriate selection for the functions in which the results
depend on database lookups, parameter variables (such as the current time zone), etc.
Also note that the current_timestamp family of functions qualify as stable, since their
values do not change within a transaction.
Volatile indicates that the function value can change even within a single table scan, so
no optimizations can be made. Relatively few database functions are volatile in this
sense; some examples are random(), currval(), timeofday(). Note that any function
that has side-effects must be classified volatile (even if its result is quite predictable) to
prevent calls from being optimized away; an example is setval().
Note: You can also add the function definition within the Properties 130 tab of Function
Editor 130 .
Execute As
Specify the security context under which the UDF is to be executed (For details see
Execute As Clause (Microsoft SQL 2005 References)).
Schema Binding
Check the option to indicate that the UDF is bound to the database objects it
references.
Function Type
Define Scalar, Inline Table-valued or Multi-statement Table-valued function type for the
UDF.
· select the UDF for editing in the explorer tree (type the first letters of the UDF
name for quick search);
· select the Edit UDF item from the popup menu
or
· open Schema Editor and the UDFs tab there;
· select the UDF to edit;
· press the Enter key or select the Edit UDF item from the popup menu (alternatively,
you may use the corresponding link of the Navigation Bar).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The Parameters tab contains the list of the current UDF parameters with its options.
Here you can view the Name and the Type of each UDF parameter and also supply a
Comment for the parameter.
Parameters can be edited within the Parameter Editor dialog window. In order to open
the dialog you should
· open the object in its editor and the Parameters tab there;
· select the parameter to edit;
· press the Enter key or select the Edit Parameter item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
The Definition field contains the definition of the UDF. Specify a string constant
defining the UDF here; the meaning depends on the language. It may be an internal
UDF name, the path to an object file, an SQL command or text in a procedural
language.
Name
You can edit the UDF name here. The name of the UDF must be unique among all the
UDF names in the database.
Owner
The field contains the owner of the UDF. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Comment
Specify a comment to the UDF if necessary.
Create Date
Displays the date when the UDF was created.
Modify Date
Displays the date when the UDF was last modified.
The Encrypted option is checked to indicate that Microsoft SQL server will convert the
original text of the CREATE FUNCTION statement to an obfuscated format. The output
of the obfuscation is not directly visible.
Execute As
Specify the security context under which the UDF is to be executed (For details see
Execute As Clause (Microsoft SQL 2005 References)).
Schema Binding
Check the option to indicate that the UDF is bound to the database objects it
references.
Function Type
Define Scalar, Inline Table-valued or Multi-statement Table-valued function type for the
UDF.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.5.2.2 Viewing UDF results
If the procedure/UDF/CLR UDF has parameters, MS SQL Maestro will ask you to specify
the values for these parameters in the Input parameters dialog which appears before the
procedure execution. Input parameters dialog allows you to specify the values for all
input parameters. After changes are made, click the OK button to execute the UDF, or
the Cancel button to abort the execution.
MS SQL Maestro supports Parameter History. Values that have been set previously as
the routine parameters are represented in the History tab of the Input Parameter dialog
with a date and time of their last using. Double click a necessary set of values to set
them as the routine parameters. You can manage the Parameter History with Delete
history item and Clear history links.
The result of the successfully executed routine can be found within the Results tab of
Procedure/UDF/CLR UDF Editor.
Note: If any unsaved changes are applied to the routine being currently edited, the
execution of the routine is impossible until changes are saved by the Compile
procedure item of the Navigation Bar.
5.6 UDTs
SQL Server 2005 adds support for user-defined types (UDTs) implemented with the
Microsoft .NET Framework common language runtime (CLR). The CLR is integrated into
SQL Server, and this new mechanism enables you to extend the type system of the
database. UDTs provide user extensibility of the SQL Server data type system, and also
the ability to define complex structured types.
New UDTs are created within Create UDT Wizard. In order to run the
wizard you should either
To create a new UDT with the same properties as one of the existing
UDTs has:
UDTs can be edited within UDT Editor 137 . In order to run the editor
you should either
· select the UDT for editing in the explorer tree (type the first
letters of the UDT name for quick search);
· select the Edit UDT... item from the popup menu
or
· open Schema Editor and the UDTs tab there;
· select the UDT to edit;
· press the Enter key or select the Edit UDT item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can change the name of the UDT using the Rename UDT dialog.
To open the dialog you should either
or
· open Schema Editor and the UDTs tab there;
· select the UDT to rename;
· select the Rename UDT item from the popup menu (alternatively,
you may use the corresponding link of the Navigation Bar).
To drop a UDT:
To create a new UDT with the same properties as one of the existing UDTs has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Specify the properties for the new UDT according to your needs. The detailed
description is given below.
Owner
Select the owner of the UDT from the drop-down list. By default, only the owner of an
object can perform various operations with the object. In order to allow other users to
operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Comment
Supply a comment to the UDT if necessary.
Data Type
Select the underlying data type for the UDT. This may include array specifiers.
Use the Size edit box to define the length of the parameter value for float, char and
other data types, and the Precision edit box to define the precision of the parameter
value, e.g. for decimal data type.
Not Null
The checkbox indicates that the values of the UDT are not allowed to be null.
Default
The field displays the UDT value accepted by default when no value is explicitly supplied.
Rule
Specify a rule for the UDT.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
UDT Editor provides you with an ability to edit UDT properties. The Properties tab allows
you to change the UDT name, the UDT owner, etc.
Name
Here you can view and edit the UDT name. The name of the UDT must be unique among
all the UDT names in the database.
Owner
By default, only the owner of an object can perform various operations with the object.
In order to allow other users to operate it, privileges must be granted. (However, users
that have the superuser attribute can always access any object.)
Comment
This field stores a comment to the UDT.
Not Null
The checkbox indicates that the values of the UDT are not allowed to be null.
Default
The field displays the UDT value accepted by default when no value is explicitly supplied.
Rule
The field specifies a rule for the UDT.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.7 Synonyms
A synonym is an alternative name for a schema-scoped object. You can use a single-
part name to reference a base object by using a synonym instead of using a two-part,
three-part, or four-part name to reference the base object. Synonyms were
implemented in SQL Server 2005.
· select the synonym for editing in the explorer tree (type the first
letters of the synonym name for quick search);
· select the Edit Synonym ... item from the popup menu
or
· open the schema in Schema Editor and the Synonyms tab there;
· select the synonym to edit;
· press the Enter key or select the Edit Synonym item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the synonym using the Rename
Synonym dialog. To open the dialog you should either
or
· open the schema in Schema Editor and the Synonyms tab there;
· select the synonym to rename;
· select the Rename Synonym item from the popup menu
(alternatively, you may use the corresponding link of the
Navigation Bar).
To drop a synonym:
To create a new synonym with the same properties as one of the existing synonyms
has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Owner
Select the owner for the synonym. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
Specify a comment to the synonym.
Object
Specify the base object that the synonym references.
· select the synonym for editing in the explorer tree (type the first letters of the
synonym name for quick search);
· select the Edit Synonym ... item from the popup menu
or
· open the schema in Schema Editor and the Synonyms tab there;
· select the synonym to edit;
· press the Enter key or select the Edit Synonym item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
You can change the name of the synonym using the Rename Synonym dialog. To open
the dialog you should either
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Synonym Properties
Name
You can edit the synonym name here.
Owner
Here you can view the owner for the synonym. By default, only the owner of an object
can perform various operations with the object. In order to allow other users to operate
it, privileges must be granted. (However, users that have the superuser attribute can
Comment
Specify a comment to the synonym.
Create Date
Stores the date when the synonym was created.
Modify Date
Stores the date when the synonym was last modified.
Object
The field represents the base object that the synonym references.
Synonym Data
The Data tab displays the Alias data as a grid (see Data View 326 for details). Use grid’s
popup menu to open Data Input Form, to invoke the Export Data, and Get SQL Dump
modules, to set the value of the selected record to NULL or to Now (for Date values).
For your convenience it was implemented two modes of viewing data: as table and as
info cards.
5.8 Rules
A SQL Server rule is a Transact-SQL syntax element that defines a data-integrity
constraint. A rule can be bound to a column or user-defined data type. The condition is
executed to validate data for a single column when a value is inserted into the column
bound by the rule. A rule condition can be any expression valid in a WHERE clause and
can include elements such as arithmetic operators, relational operators, and predicates
(for example, IN, LIKE, BETWEEN). Rules will be removed in the future versions of
Microsoft SQL Server. Avoid using rules in new development work, and be ready to
modify the applications that currently use it. We recommend that you use check 91
constraints instead.
New rules are created within Create Rule Wizard. In order to run the
wizard you should either
To create a new rule with the same properties as one of the existing
rules has:
Rules can be edited within Rule Editor. In order to run the editor you
should either
· select the rule for editing in the explorer tree (type the first
letters of the rule name for quick search);
· select the Edit Rule... item from the popup menu
or
· open the schema in Schema Editor and the Rules tab there;
· select the rule to edit;
· press the Enter key or select the Edit Rule item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can change the name of the rule using the Rename Rule dialog.
To drop a rule:
To create a new rule with the same properties as one of the existing rules has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
To add a new rule, specify a Comment to the rule and the rule Condition. As a condition
you can use any expression valid in a WHERE clause and which can include elements
such as arithmetic operators, relational operators, and predicates (for example, IN, LIKE,
BETWEEN).
A rule cannot reference columns or other database objects. Built-in functions that do
not reference database objects can be included. User-defined functions cannot be used.
The condition must include one variable. The at sign (@) precedes each local variable.
The expression refers to the value entered with the UPDATE or INSERT statement. Any
name or symbol can be used to represent the value when creating the rule, but the first
character must be the at sign (@).
· select the rule for editing in the explorer tree (type the first letters of the rule name
for quick search);
· select the Edit Rule... item from the popup menu
or
· open the schema in Schema Editor and the Rules tab there;
· select the rule to edit;
· press the Enter key or select the Edit Rule item from the popup menu (alternatively,
you may use the corresponding link of the Navigation Bar).
You can change the name of the rule using the Rename Rule dialog. To open the dialog
you should either
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify rule options according to your needs. The detailed description is given below.
Name
Defines a name for the rule.
Comment
Specify a comment to the rule.
Create Date
Displays the date when the rule was created.
Modify Date
Displays the date when rule was last modified.
Condition
The field represents the condition or conditions that define the rule. As a condition you
can use any expression valid in a WHERE clause and which can include elements such as
arithmetic operators, relational operators, and predicates (for example, IN, LIKE,
BETWEEN).
A rule cannot reference columns or other database objects. Built-in functions that do
not reference database objects can be included. User-defined functions cannot be used.
The condition must include one variable. The at sign (@) precedes each local variable.
The expression refers to the value entered with the UPDATE or INSERT statement. Any
name or symbol can be used to represent the value when creating the rule, but the first
character must be the at sign (@).
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.9 Defaults
A default specifies a value to be inserted into the column to which the object is bound
(or into all columns, in the case of a user-defined data type) when no value is explicitly
supplied during an insert action.
· select the default for editing in the explorer tree (type the first
letters of the default name for quick search);
· select the Edit Default ... item from the popup menu
or
· open the schema in Schema Editor and the Defaults tab there;
· select the default to edit;
· press the Enter key or select the Edit Default item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the default using the Rename Default
dialog. To open the dialog you should either
To drop a default:
To create a new default with the same properties as one of the existing defaults has:
To add a new default, specify a comment to the default and set the default value. The
value must be an expression that contains only constant values (it cannot include the
names of any columns or other database objects). Any constant, built-in function, or
mathematical expression can be used, except those that contain alias data types. User-
defined functions cannot be used. Enclose character and date constants in single
quotation marks ('); monetary, integer, and floating-point constants do not require
quotation marks. Binary data must be preceded by 0x, and monetary data must be
preceded by a dollar sign ($). The default value must be compatible with the column
data type.
· select the default for editing in the explorer tree (type the first letters of the default
name for quick search);
· select the Edit Default ... item from the popup menu
or
· open the schema in Schema Editor and the Defaults tab there;
· select the default to edit;
· press the Enter key or select the Edit Default item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
You can change the name of the default using the Rename Default dialog. To open the
dialog you should either
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify default options according to your needs. The detailed description is given below.
Name
You can edit the default name here.
Comment
Specify a comment to the default.
Create Date
Indicates the date when the default was created.
Modify Date
Indicates the date when the default was last modified.
Value
Specify the value for the default. It can be an expression that contains only constant
values (it cannot include the names of any columns or other database objects). Any
constant, built-in function, or mathematical expression can be used, except those that
contain alias data types. User-defined functions cannot be used. Enclose character and
date constants in single quotation marks ('); monetary, integer, and floating-point
constants do not require quotation marks. Binary data must be preceded by 0x, and
monetary data must be preceded by a dollar sign ($). The default value must be
compatible with the column data type.
A file table is a specialized user table that has a pre-defined and fixed schema. This
schema stores FILESTREAM data, file and directory information, and file attributes. To
add a new file table, you need to specify the directory that serves as the root directory
for all the files and directories stored in the file table as File Name Directory Name, and
the name of the collation to be applied to the Name column in the file table as File Name
Column Collation. If you do not provide a directory name when you create the file table,
then the name of the file table itself is used as the directory name.
After the creation, file tables are available to use as ordinary database tables. You can
work with their data within the corresponding editor as usual: load files to tables 326 ,
query, export, and import tables data and as well as through the Windows file system.
New CLR procedures are created within Create CLR Procedure Wizard.
In order to run the wizard you should either
· select the CLR procedure for editing in the explorer tree (type
the first letters of the CLR procedure name for quick search);
· select the Edit CLR Procedure ... item from the popup menu
or
· open the schema in Schema Editor and the CLR Procedures tab
there;
· select the CLR procedure to edit;
· press the Enter key or select the Edit CLR Procedure item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar).
You can change the name of the CLR procedure using the Rename
CLR Procedure dialog. To open the dialog you should either
· select the Rename CLR Procedure item from the popup menu
or
· open the schema in Schema Editor and the CLR Procedures tab
there;
· select the CLR procedure to rename;
· select the Rename CLR Procedure item from the popup menu
(alternatively, you may use the corresponding link of the
Navigation Bar).
· select the CLR procedure in the explorer tree (type the first
letters of the CLR procedure name for quick search);
· select the Edit CLR Procedure ... item from the popup menu;
· execute the CLR procedure using the Execute link of the
Navigation Bar
or
· open the schema in Schema Editor and the CLR Procedures tab
there;
· select the CLR procedure to execute;
· press the Enter key or select the Edit CLR Procedure item from
the popup menu, or use the corresponding link of the Navigation
Bar;
· execute the CLR procedure using the Execute link of the
Navigation bar.
or
· select the CLR Procedures list or any object from that list in the explorer tree;
· select the Create New CLR Procedure... item from the popup menu
or
· open the schema in Schema Editor and the CLR Procedures tab there;
· press the Insert key or select the Create New CLR Procedure... item from the popup
menu (alternatively, you may use the corresponding link of the Navigation Bar).
To create a new CLR procedure with the same properties as one of the existing CLR
procedures has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
The Execute As option defines the security context under which the CLR procedure is to
be executed (for details see Execute As Clause (Microsoft SQL 2005 References)).
Click the Add button to set new parameter options within Parameter Editor.
Use the Parameter name field to set the name to a parameter. Note that the name of
the parameter must be unique among parameter names in the procedure.
The Data type drop-down list defines the type of the parameter.
The Default value box specifies a parameter value when no value is explicitly supplied.
Use the Scope box to set whether the parameter is Input or Input-Output.
· select the CLR procedure for editing in the explorer tree (type the first letters of the
CLR procedure name for quick search);
· select the Edit CLR Procedure ... item from the popup menu
or
· open the schema in Schema Editor and the CLR Procedures tab there;
· select the CLR procedure to edit;
· press the Enter key or select the Edit CLR Procedure item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
You can change the name of the CLR procedure using the Rename CLR Procedure dialog.
To open the dialog you should either
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The Parameters tab contains the list of the current CLR procedure parameters with its
options. Here you can find the Name and the Type of each parameter of the CLR
procedure and also the Comment for the parameter.
The Properties tab allows you to specify CLR procedure options according to your needs.
The detailed description is given below.
Name
You can edit the CLR procedure name here.
Owner
The field represents the owner of the CLR procedure. By default, only the owner of an
object can perform various operations with the object. In order to allow other users to
operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Comment
Specify a comment to the CLR procedure.
Create Date
Indicates the date when the CLR procedure was created.
Modify Date
Indicates the date when the CLR procedure was last modified.
Execute As
Specifies the security context under which to execute the CLR procedure (For details
see Execute As Clause (Microsoft SQL 2005 References)).
Parameters
Here you can find the list of the CLR procedure parameters.
CLR Procedure Editor provides an ability to execute current procedure. For this purpose
use the corresponding item at the Navigation Bar. If the procedure has parameters, the
Input Parameters dialog appears before the execution. It allows you to specify the
values for all input parameters. After changes are made, click the OK button to execute
the CLR procedure, or the Cancel button to abort the execution.
Note: If any unsaved changes are applied to the procedure currently edited, the
execution of the procedure is impossible until changes are saved by the Compile
CLR procedure item of the Navigation Bar.
New CLR UDFs are created within Create CLR UDF Wizard. In order to
run the wizard you should either
To create a new CLR UDF with the same properties as one of the
existing CLR UDFs has:
CLR UDFs can be edited within CLR UDF Editor. In order to run the
editor you should either
· select the CLR UDF for editing in the explorer tree (type the first
letters of the CLR UDF name for quick search);
· select the Edit CLR UDF ... item from the popup menu
or
· open the schema in Schema Editor and the CLR UDFs tab there;
· select the CLR UDF to edit;
· press the Enter key or select the Edit CLR UDF item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the CLR UDF using the Rename CLR UDF
dialog. To open the dialog you should either
· open the schema in Schema Editor and the CLR UDFs tab there;
· select the CLR UDF to rename;
· select the Rename CLR UDF item from the popup menu
(alternatively, you may use the corresponding link of the
Navigation Bar).
· select the CLR UDF in the explorer tree (type the first letters of
the CLR UDF name for quick search);
· select the Edit CLR UDF ... item from the popup menu;
· execute the CLR UDF using the Execute link of the Navigation
Bar
or
· open the schema in Schema Editor and the CLR UDFs tab there;
· select the CLR UDF to execute;
· press the Enter key or select the Edit CLR UDF item from the
popup menu, or use the corresponding link of the Navigation Bar;
· execute the CLR UDF using the Execute link of the Navigation bar
.
(alternatively, you may use the corresponding link of the Navigation Bar).
To create a new CLR UDF with the same properties as one of the existing CLR UDFs has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Owner
Select the owner of the CLR UDF. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
Specify a comment to the CLR UDF.
Execute As
Specifies the security context under which the CLR UDF is to be executed.
Function Type
Defines Scalar, Inline Table-valued or Multi-statement Table-valued UDF function type.
Managing parameters
Click the Add button to add a new parameter and set its properties in Parameter Editor
52 . Click the Edit button to edit the selected parameter, or the Delete button to delete
one.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The Results tab represents the result of the successfully executed CLR UDF.
The Parameters tab contains the list of the current CLR UDF parameters with its options.
Here you can find the Name and the Type of each parameter of the CLR UDF and also
the Comment for the parameter.
The Properties tab allows you to specify CLR UDF options according to your needs. The
detailed description is given below.
Name
You can edit the CLR UDF name here.
Owner
Select the owner of the CLR UDF. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
Specify a comment to the CLR UDF.
Create Date
Indicates the date when the CLR UDF was created.
Modify Date
Indicates the date when the CLR UDF was last modified.
Execute As
Specifies the security context under which the CLR UDF is to be executed.
Function Type
Defines Scalar, Inline Table-valued or Multi-statement Table-valued UDF function type.
Parameters
Here you can find the list of the CLR UDF parameters.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
New CLR UDTs are created within Create CLR UDT Wizard. In order to
run the wizard you should either
To create a new CLR UDT with the same properties as one of the
existing CLR UDTs has:
CLR UDTs can be edited within CLR UDT Editor. In order to run the
editor you should either
· select the CLR UDT for editing in the explorer tree (type the first
letters of the CLR UDT name for quick search);
· select the Edit CLR UDT ... item from the popup menu
or
· open the schema in Schema Editor and the CLR UDTs tab there;
· select the CLR UDT to edit;
· press the Enter key or select the Edit CLR UDT item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the CLR UDT using the Rename CLR UDT
dialog. To open the dialog you should either
or
· open the schema in Schema Editor and the CLR UDTs tab there;
· select the CLR UDT to rename;
· select the Rename CLR UDT item from the popup menu
(alternatively, you may use the corresponding link of the
Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
To add a new CLR UDT, specify its Comment and Owner. By default, only the owner of
an object can perform various operations with the object. In order to allow other users
to operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Assembly, Class
Specifies the method of a .NET Framework assembly for a CLR stored function to
reference. Class must be a valid SQL Server identifier and must exist as a class in the
Assembly 212 .
· select the CLR UDT for editing in the explorer tree (type the first letters of the CLR
UDT name for quick search);
· select the Edit CLR UDT ... item from the popup menu
or
· open the schema in Schema Editor and the CLR UDTs tab there;
· select the CLR UDT to edit;
· press the Enter key or select the Edit CLR UDT item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
You can change the name of the CLR UDT using the Rename CLR UDT dialog. To open
the dialog you should either
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Name
Specify the CLR UDT name.
Owner
Select the owner of the CLR UDT.
Comment
Specify a comment to the CLR UDT.
Assembly, Class
Defines the method of a .NET Framework assembly for a CLR stored function to
reference. Class must be a valid SQL Server identifier and must exist as a class in the
Assembly 212 .
Before you can create typed XML variables, parameters or columns, you must first
register the XML schema collection. You can then associate the XML schema collection
with variables, parameters, or columns of the xml data type.
Note: the XML schema collection is a metadata entity like a table in the
database. You can create, modify, and drop them.
New XML schema collections are created within Create XML Schema
Collection Wizard. In order to run the wizard you should either
· select the XML Schema Collection for editing in the explorer tree
(type the first letters of the XML Schema Collection name for
quick search);
· select the Edit XML Schema Collection ... item from the popup
menu
or
· open the schema in Schema Editor and the XML Schema
Collections tab there;
· select the XML Schema Collection to edit;
· press the Enter key or select the Edit XML Schema Collection
item from the popup menu (alternatively, you may use the
corresponding link of the Navigation Bar).
You can change the name of the XML Schema Collection using the
Rename XML Schema Collection dialog. To open the dialog you should
either
tree;
· select the Create New XML Schema Collection... item from the popup menu
or
· open the schema in Schema Editor and the XML Schema Collections tab there;
· press the Insert key or select the Create New XML Schema Collection... item from
the popup menu (alternatively, you may use the corresponding link of the Navigation
Bar).
To create a new XML schema collection with the same properties as one of the existing
XML schema collections has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Owner
Defines the owner of the XML Schema Collection.
Comment
Specify a comment to the XML Schema Collection.
Definition
Is a string constant or scalar variable. Is varchar, varbinary, nvarchar, or xml type. You
need not to set the definition on XML Schema Collection on creation. It is an optional
wizard step. You can do it later using a non-modal editor.
· select the XML Schema Collection for editing in the explorer tree (type the first
letters of the XML Schema Collection name for quick search);
· select the Edit XML Schema Collection ... item from the popup menu
or
· open the schema in Schema Editor and the XML Schema Collections tab there;
· select the XML Schema Collection to edit;
· press the Enter key or select the Edit XML Schema Collection item from the popup
menu (alternatively, you may use the corresponding link of the Navigation Bar).
You can change the name of the XML Schema Collection using the Rename XML Schema
Collection dialog. To open the dialog you should either
· open the schema in Schema Editor and the XML Schema Collections tab there;
· select the XML Schema Collection to rename;
· select the Rename XML Schema Collection item from the popup menu (alternatively,
you may use the corresponding link of the Navigation Bar).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Name
Defines the name of the XML Schema Collection.
Owner
Defines the owner of the XML Schema Collection. By default, only the owner of an
object can perform various operations with the object. In order to allow other users to
operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Comment
Specify a comment to the XML Schema Collection.
Definition
Is a string constant or scalar variable. Is varchar, varbinary, nvarchar, or xml type.
5.15 Queues
MS SQL Maestro supports Service Broker communications designed around reliable,
asynchronous message delivery. Queues store messages. When Service Broker receives
a message for a service, Service Broker inserts the message into the queue for that
service. To get messages sent to the service, an application receives messages from
the queue. Service Broker manages queues and presents a view of a queue that is
similar to a table.
Each service is associated with one queue. When a message arrives for a service,
Service Broker places the message in the queue associated with that service.
Each message is a row in the queue. The row contains the content of the message as
well as information about the message type, the service targeted by the message, the
contract that the message follows, the validation performed on the message, the
conversation that the message is a part of, and information internal to the queue. An
application uses the information in the message row to identify each message uniquely
and process the message appropriately.
Create Queue Wizard 172 guides you through the process of creating
a new queue. In order to run the wizard you should either
Queue Editor 173 allows you to change queue status, retention, and
also activation options. In order to run the editor you should either
· select the queue for editing in the explorer tree (type the first
letters of the queue name for quick search);
· select the Edit Queue ... item from the popup menu
or
· open the schema in Schema Editor and the Queues tab there;
· select the queue to edit;
· press the Enter key or select the Edit Queue item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
To drop a queue:
To create a new queue with the same properties as one of the existing one has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Queue Properties
Name
Enter the name of the queue to create. This name must meet the guidelines for SQL
Server identifiers.
Owner
Defines the owner of the queue.
Status
Specifies whether the queue is available (checked) or unavailable (unchecked). When
the queue is unavailable, no messages can be added to the queue or removed from the
queue. You can create the queue in an unavailable state in order to keep messages from
arriving on the queue until the queue is made available within Queue Editor 173 .
Retention
Specifies the retention setting for the queue. If checked, all messages sent or received
on conversations using this queue are retained in the queue until the conversations have
ended. This allows you to retain messages for auditing purposes, or to perform
compensating transactions if an error occurs.
Procedure name
Specifies the name of the stored procedure to activate to process messages in this
queue. This value must be a SQL Server identifier.
Status
Specifies whether or not Service Broker activates the stored procedure. When checked,
the queue starts the stored procedure specified with Procedure name when the number
of procedures currently running is less than Max readers and when messages arrive on
the queue faster than the stored procedures receive messages. When unchecked, the
queue does not activate the stored procedure.
Max readers
Specifies the maximum number of instances of the activation stored procedure that the
queue starts at the same time. The value of readers must be a number between 0 and
32767.
Execute As
Specifies the SQL Server database user account under which the activation stored
procedure runs. SQL Server must be able to check the permissions for this user at the
time that the queue activates the stored procedure. For an NT domain user, the server
must be connected to the domain when the procedure is activated or activation fails.
For a SQL Server user, the server can always check permissions.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing queue properties 173
· Managing queue data 174
Use the Receive messages link on the Navigation bar to open SQL Editor with a
corresponding query. Execute the query to receive messages (with their deleting from
You can also change queue properties here. The detailed description is given below.
Common options tab represents the name, owner and ID of the queue. By default, only
the owner of an object can perform various operations with the object. In order to allow
other users to operate it, privileges must be granted. (However, users that have the
superuser attribute can always access any object.)
Status
Use the checkbox to specify whether the queue is available (ON) or unavailable (OFF).
When the queue is unavailable, no messages can be added to the queue or removed
from the queue.
Retention
Specifies the retention setting for the queue. If checked, all messages sent or received
on conversations using this queue are retained in the queue until the conversations have
ended. This allows you to retain messages for auditing purposes, or to perform
compensating transactions if an error occurs
Note: Setting the retention ON can reduce performance. This setting should only be
used if required to meet the service level agreement for the application.
Procedure name
Specifies the name of the stored procedure to activate to process messages in this
queue. This value must be a SQL Server identifier.
Status
Specifies whether or not Service Broker activates the stored procedure. When checked,
the queue starts the stored procedure specified with Procedure name when the number
of procedures currently running is less than Max readers and when messages arrive on
the queue faster than the stored procedures receive messages. When unchecked, the
queue does not activate the stored procedure.
Max readers
Use the field to change the maximum number of instances of the activation stored
procedure that the queue starts at the same time. The value of readers must be a
number between 0 and 32767.
Execute As
Specifies the SQL Server database user account under which the activation stored
procedure runs. SQL Server must be able to check the permissions for this user at the
time that the queue activates the stored procedure. For an NT domain user, the server
must be connected to the domain when the procedure is activated or activation fails.
For a SQL Server user, the server can always check permissions.
The Data tab displays the queue messages as a grid (see Data View 326 for details). Use
grid’s popup menu to open Data Input Form, to invoke the Export Data, and Get SQL
Dump modules, to set the value of the selected record to NULL or to Now (for Date
values). To delete the queue from the grid, use the Receive messages link on the
Navigation bar and execute the corresponding query in the SQL Editor. You can find
description of the queue columns below.
For your convenience it was implemented two modes of viewing data: as table and as
info cards.
Each message type specifies the validation that SQL Server performs for messages of
that type. SQL Server can validate that the message contains valid XML, that the
message contains XML conforming to a particular schema, or that the message contains
no data at all. For arbitrary or binary data, the message type can specify that SQL
Server does not validate the content of the message.
Validation is performed when the destination service receives the message. If the
content of the message does not match the validation specified, Service Broker returns
an error message to the service that sent the message.
Create Message Type Wizard 178 guides you through the process of
creating a new type of Service Broker messages. In order to run the
wizard you should either
Message Type Editor 178 allows you to change the type options. In
order to run the editor you should either
· select the type for editing in the explorer tree (type the first
letters of the type name for quick search);
· select the Edit Message Type ... item from the popup menu
or
· open the database in Database Editor and the Message Types
tab there;
· select the type to edit;
· press the Enter key or select the Edit Message Type item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· select the type for editing in the explorer tree (type the first letters of the type
name for quick search);
· select the Edit Message Type ... item from the popup menu
or
· open the database in Database Editor and the Message Types tab there;
· select the type to edit;
· press the Enter key or select the Edit Message Type item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing message type properties 179
Owner
Sets the owner of the message type to the specified database user or role. When the
current user is dbo or sa, the Owner may be the name of any valid user or role.
Otherwise, Owner must be the name of the current user, the name of a user that the
current user has impersonate permissions for, or the name of a role to which the current
user belongs. In case the field is blanck the message type belongs to the current user.
Validation type
Specifies how Service Broker validates the message body for messages of this type.
None No validation is performed. The message body may contain
any data, or may be NULL.
Empty The message body must be NULL.
XML The message body must contain well-formed XML.
5.17 Contracts
MS SQL Maestro supports Service Broker communications designed around reliable,
asynchronous message delivery. A contract is an agreement between two services
about which messages each service sends to accomplish a particular task. Contract
definitions persist in the database where the type is created. A contract defines which
message types an application uses to accomplish a particular task.
The contract specifies which message types can be used to accomplish the desired
work. The contract also specifies which participant in the conversation can use each
message type. Some message types can be sent by either participant; other message
types are restricted to be sent only by the initiator or only by the target. A contract
must contain a message type sent by the initiator or a message type sent by either
participant; otherwise, there is no way for the initiator to begin a conversation that
uses the contract.
· select the contract for editing in the explorer tree (type the first
letters of the queue name for quick search);
· select the Edit Contract ... item from the popup menu
or
· open the database in Database Editor and the Contracts tab
there;
To drop a contract:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· select the contract for editing in the explorer tree (type the first letters of the
queue name for quick search);
· select the Edit Contract ... item from the popup menu
or
· open the database in Database Editor and the Contracts tab there;
· select the contract to edit;
· press the Enter key or select the Edit Contract item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Initiator: Indicates that only the initiator of the conversation can send messages of the
specified message type. A service that begins a conversation is referred to as the
initiator of the conversation.
Target: Indicates that only the target of the conversation can send messages of the
specified message type. A service that accepts a conversation that was started by
another service is referred to as the target of the conversation.
5.18 Services
MS SQL Maestro supports Service Broker communications designed around reliable,
asynchronous message delivery. A service exposes the functionality provided by
contracts with which it is associated, so that they can be used by other services.
Conversations initiated from this service may use any contract. You create a service
without specifying contracts when the service only initiates conversations.
When Service Broker accepts a new conversation from a remote service, the name of
the target service determines the queue where the broker places messages in the
conversation.
Create Service Wizard 184 guides you through the process of creating
a new Service Broker service. In order to run the wizard you should
either
· select the service for editing in the explorer tree (type the first
letters of the service name for quick search);
· select the Edit Service ... item from the popup menu
or
· open the database in Database Editor and the Services tab
there;
· select the service to edit;
· press the Enter key or select the Edit Service item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
To drop a service:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Name
Enter the name of the service to create. The name must be a valid sysname.
Owner
Sets the owner of the service to the specified database user or role. When the current
user is dbo or sa, owner may be the name of any valid user or role. Otherwise, owner
must be the name of the current user, the name of a user that the current user has
impersonate permissions for, or the name of a role to which the current user belongs.
Queue
Specifies the queue that receives messages for the service. The queue must exist in the
same database as the service.
Contracts
Specify contracts for which this service may be a target. Service programs initiate
conversations to this service using the contracts specified. If no contracts are
specified, the service may only initiate conversations.
· select the service for editing in the explorer tree (type the first letters of the
service name for quick search);
· select the Edit Service ... item from the popup menu
or
· open the database in Database Editor and the Services tab there;
· select the service to edit;
· press the Enter key or select the Edit Service item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Common options tab represents the name, owner and ID of the queue. By default, only
the owner of an object can perform various operations with the object. In order to allow
other users to operate it, privileges must be granted. (However, users that have the
superuser attribute can always access any object.)
Queue
Specifies the queue that receives messages for the service. The queue must exist in the
same database as the service.
Contracts
Specify contracts for which this service may be a target. Service programs initiate
conversations to this service using the contracts specified. If no contracts are
specified, the service may only initiate conversations.
5.19 Conversations
MS SQL Maestro supports Service Broker communications designed around reliable,
asynchronous message delivery. All messages sent by Service Broker are part of a
conversation. A dialog conversation, or dialog, is a conversation between two
services. In effect, a dialog is a reliable, persistent bidirectional stream of messages
between two services.
A dialog conversation has two participants. The initiator begins the conversation. The
target accepts a conversation begun by the initiator. Whether a participant begins the
conversation determines the messages that the participant can send, as specified in the
contract for the conversation.
· select the conversation for editing in the explorer tree (type the
first letters of the conversation name for quick search);
· select the Edit Conversation ... item from the popup menu
or
· open the database in Database Editor and the Conversations tab
there;
· select the conversation to edit;
· press the Enter key or select the Edit Conversation item from
the popup menu (alternatively, you may use the corresponding
To drop a conversation:
Conversation options
Initiator service
Specifies the service that initiates the dialog. The name specified must be the name of a
service in the current database. The queue specified for the initiator service receives
messages returned by the target service and messages created by Service Broker for
this conversation.
Target service
Specifies the target service with which to initiate the dialog. The target_service_name is
of type nvarchar(256). Service Broker uses a byte-by-byte comparison to match the
target_service_name string. In other words, the comparison is case-sensitive and does
not take into account the current collation.
Contract
Specifies the contract that this conversation follows. The contract must exist in the
current database. If the target service does not accept new conversations on the
contract specified, Service Broker returns an error message on the conversation.
Related conversation
Specifies the existing conversation group that the new dialog is added to. When this
clause is present, the new dialog belongs to the same conversation group as the dialog
specified by related conversation. The conversation must be of a type implicitly
Life time
Specifies the maximum amount of time the dialog will remain open. For the dialog to
complete successfully, both endpoints must explicitly end the dialog before the lifetime
expires. The lifetime value must be expressed in seconds. Lifetime is of type int.
Encryption
Specifies whether or not messages sent and received on this dialog must be encrypted
when they are sent outside of a Microsoft SQL Server instance. A dialog that must be
encrypted is a secured dialog. When unchecked and the certificates required to support
encryption are not configured, Service Broker returns an error message on the
conversation. If checked, encryption is used if a remote service binding is configured for
the target service; otherwise messages are sent unencrypted.
Messages are the information exchanged between applications that use Service Broker.
· select the conversation for editing in the explorer tree (type the first letters of the
conversation name for quick search);
· select the Edit Conversation ... item from the popup menu
or
· open the database in Database Editor and the Conversations tab there;
· select the conversation to edit;
· press the Enter key or select the Edit Conversation item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Initiator service
Specifies the service that initiates the dialog. The name specified must be the name of a
service in the current database. The queue specified for the initiator service receives
messages returned by the target service and messages created by Service Broker for
this conversation.
Target service
Specifies the target service with which to initiate the dialog. The target_service_name is
of type nvarchar(256). Service Broker uses a byte-by-byte comparison to match the
target_service_name string. In other words, the comparison is case-sensitive and does
not take into account the current collation.
Contract
Specifies the contract that this conversation follows. The contract must exist in the
current database. If the target service does not accept new conversations on the
contract specified, Service Broker returns an error message on the conversation.
Related conversation
Specifies the existing conversation group that the new dialog is added to. When this
clause is present, the new dialog belongs to the same conversation group as the dialog
specified by related conversation. The conversation must be of a type implicitly
convertible to type uniqueidentifier.
Life time
Specifies the maximum amount of time the dialog will remain open. For the dialog to
complete successfully, both endpoints must explicitly end the dialog before the lifetime
expires. The lifetime value must be expressed in seconds. Lifetime is of type int.
Encryption
Specifies whether or not messages sent and received on this dialog must be encrypted
when they are sent outside of a Microsoft SQL Server instance. A dialog that must be
encrypted is a secured dialog. When unchecked and the certificates required to support
encryption are not configured, Service Broker returns an error message on the
conversation. If checked, encryption is used if a remote service binding is configured for
the target service; otherwise messages are sent unencrypted.
5.20 Aggregates
Like most other relational database products, Microsoft SQL supports aggregate
functions. An aggregate function computes a single result from multiple input rows.
Some basic and commonly-used aggregate functions are included with the distribution. If
one defines new types or needs an aggregate function not already provided, then an
Aggregate can be used to provide the stated features.
· select the aggregate for editing in the explorer tree (type the
first letters of the aggregate name for quick search);
· select the Edit Aggregate ... item from the popup menu
or
· open the schema in Schema Editor and the Aggregates tab
there;
· select the aggregate to edit;
· press the Enter key or select the Edit Aggregate item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the aggregate using the Rename
Aggregate dialog. To open the dialog you should either
To drop an aggregate:
To create a new aggregate with the same properties as one of the existing aggregates
has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Several options can be specified for the aggregate function that govern the expected
Owner
Defines the owner of the new aggregate. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Comment
The box allows you to set optional text to describe the new aggregate.
Parameter Name
The field represents a parameter in the user-defined aggregate. The value of the
parameter must be supplied by the user when the aggregate function is executed.
Input Type
Defines the type of parameter.
Return Type
Defines the return type of the aggregate function.
CLR
Specifies the assembly 212 to bind with the user-defined aggregate function and the
name of the class in the assembly that implements the user-defined aggregate. The
assembly is to have been already created in the database.
· select the aggregate for editing in the explorer tree (type the first letters of the
aggregate name for quick search);
· select the Edit Aggregate ... item from the popup menu
or
· open the schema in Schema Editor and the Aggregates tab there;
· select the aggregate to edit;
· press the Enter key or select the Edit Aggregate item from the popup menu
(alternatively, you may use the corresponding link of the Navigation Bar).
You can change the name of the aggregate using the Rename Aggregate dialog. To open
the dialog you should either
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing aggregate properties 193
Aggregate Editor provides you with an ability to edit aggregate properties. The
Properties tab allows you to change the aggregate name, the aggregate owner and the
comment for the aggregate.
Name
Here you can change the aggregate name.
Owner
Set the owner for the aggregate. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
This field stores a comment to the aggregate.
Parameter Name
The field stores a parameter in the user-defined aggregate. The value of the parameter
must be supplied by the user when the aggregate function is executed.
Input Type
Defines the type of parameter.
Return Type
Defines the return type of the aggregate function.
CLR
Specifies the assembly to bind with the user-defined aggregate function and the name
of the class in the assembly that implements the user-defined aggregate. The assembly
is to have been already created in the database.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.21 Sequences
A sequence is a user-defined schema-bound object that generates a sequence of
numeric values according to the specification with which the sequence was created.
The sequence of numeric values is generated in an ascending or descending order at a
defined interval and may cycle (repeat) as requested. Sequences, unlike identity
columns, are not associated with tables. An application refers to a sequence object to
receive its next value. The relationship between sequences and tables is controlled by
the application. User applications can reference a sequence object and coordinate the
values keys across multiple rows and tables.
· select the sequence for editing in the explorer tree (type the
first letters of the sequence name for quick search);
· select the Edit Sequence ... item from the popup menu
or
· open the schema in Schema Editor and the Sequences tab there;
· select the sequence to edit;
· press the Enter key or select the Edit Sequence item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
To drop a sequence:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Name
The field allows you to specify the new sequence name being set on the previous wizard
step.
Owner
Defines the owner of the new sequence.
Comment
The box allows you to set optional text to describe the new sequence.
Value
Specify the starting sequence value here. The default starting value is minvalue for
ascending sequences and maxvalue for descending ones.
Increment by
Specify which value is added to the current sequence value to create a new value. A
positive value will make an ascending sequence, a negative one a descending sequence.
The default value is 1.
Maximum Value
Determine the maximum value for the sequence. If this clause is not supplied or NO
MAXVALUE is specified, then default values will be used. The defaults are 2^63-1 and -1
for ascending and descending sequences, respectively.
Minimum Value
Determine the minimum value a sequence can generate. If this clause is not supplied or
NO MINVALUE is specified, then defaults will be used. The defaults are 1 and -263-1 for
ascending and descending sequences, respectively.
Cashe
Specify how many sequence numbers are to be preallocated and stored in memory for
faster access. The minimum value is 1 (only one value can be generated at a time, i.e.,
no cache), and this is also the default.
Cycle
The CYCLE option allows the sequence to wrap around when the maxvalue or minvalue
has been reached by an ascending or descending sequence respectively. If the limit is
reached, the next number generated will be the minvalue or maxvalue, respectively.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Name
Here you can rename the sequence.
Owner
Shows the owner of the sequence. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
This field stores a comment to the sequence.
Created
The field represents the date the sequence was created.
OID
This field contains the sequence OID (object identifier). This is a serial number that is
automatically added by PostgreSQL to all sequences.
Increment by
Here you can edit the value which is added to the current sequence value to create a
new value.
The Maximum Value and the Minimum Value contain the maximum and the minimum values
for the sequence.
Cashe
Specify how many sequence numbers are to be preallocated and stored in memory for
faster access.
Cycle
The checkbox represents whether the sequence is cycle.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.22 Users
A user passes through two stages of security when working in Microsoft® SQL Server™:
authentication and authorization (permissions validation). The authentication stage
identifies the user using a login account 243 and verifies only the ability to connect to an
instance of SQL Server. If authentication is successful, the user connects to an
instance of SQL Server. The user then needs permissions to access databases on the
server performed by granting access to an account in each database, mapped to the
user login.
Every database cluster contains a set of database users. Those users are separate from
the users managed by the operating system under which the server runs. Users own
database objects (for example, tables) and can assign privileges on those objects to
other users to control who has access to which object.
Note: Use of roles 202 simplifies security administration in databases with a large
number of users or with a complex security system.
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Specify the Name by which the user is identified inside this database.
Note: the name of the object must be unique among all the object names in its
container. Moreover, all the objects that are source of data need
unique names among themselves. You can use any identifier that is
allowed by Microsoft SQL server.
Comment
This field stores a comment to the user.
Type
Indicates the user type. Possible variants are: for login, certificate and asymmetric key.
Indicates the respective database object type for which the database user is being
created.
Login
For the login user type only. Specifies the SQL Server login for which the database user is
being created.
Default Schema
For the login user type only. Specifies the first schema that will be searched by the
server when it resolves the names of objects for this database user.
Certificate
For the certificate user type only. Specifies the certificate for which the database user
is being created.
Asymmetric key
For the asymmetric key user type only. Specifies the asymmetric key for which the
database user is being created.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
This editor consists of several tabs: the Properties 200 tab allows to browse user options
and the Objects tab allows to browse database objects owned by the user.
The Properties tab allows you to change the user name, the user password, the user's
ability to create databases and users, the group list the user belongs to.
The roles list represents all the database roles. To grant/revoke role privileges use the
checkboxes in the Granted column. The Grantor and Time columns displays the database
administrators that granted the role to the user and the time of the operation
respectively.
Name
Displays the user name.
Comment
This field stores a comment to the user.
Create Date
Indicates the date when the user was created.
Modify Date
Indicates the date when the user was last modified.
Type
Defines the user type. Possible variants are: for login, certificate and asymmetric key.
Indicates the respective database object type for which the database user has been
created.
Login
For the login user type only. Specifies the SQL Server login for which the database user is
created.
Default Schema
For the login user type only. Specifies the first schema that will be searched by the
server when it resolves the names of objects for this database user.
Certificate
For the certificate user type only. Specifies the certificate for which the database user
is created.
Asymmetric key
For the asymmetric key user type only. Specifies the asymmetric key for which the
database user is created.
Roles
Add or remove a database role for the current user with the help of the corresponding
checkboxes.
Database permissions
Adds or removes a database permission for the current user with the help of the the
respective checkboxes.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.23 Roles
Principals are individuals, groups and processes that can request SQL Server resources.
Like other components of the SQL Server authorization model, principals can be arranged
in a hierarchy. The scope of influence of a principal depends on the scope of the
definition of the principal: Windows, server, database; and whether the principal is
indivisible or a collection. A Windows Login is an example of an indivisible principal, and a
Windows Group is an example of a principal that is a collection. Every principal has a
unique security identifier (SID).
Windows-level principals
· Windows Domain Login
· Database Role
· Application Role Using roles can simplify security administration in databases with a
large number of users or with a complex security system.
A database role is created as a separate object, and applies only to the database in
which that role is created. Microsoft® SQL Server™ allows Microsoft Windows NT® 4.0
or Windows® 2000 users and groups, SQL Server users, and SQL Server database roles
to be members of other roles.
New roles are created within Create Role Wizard 203 . In order to run
the wizard you should either
To create a new role with the same properties as one of the existing
roles has:
Roles can be edited within Role Editor 204 . In order to run the editor
you should either
· select the role for editing in the explorer tree (type the first
letters of the role name for quick search);
· select the Edit Role ... item from the popup menu
or
· open the database in Database Editor and the Roles tab there;
· select the role to edit;
· press the Enter key or select the Edit Role item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can change the name of the role using the Rename Role dialog.
To open the dialog you should either
To drop a role (note that you can drop database roles only):
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Specify role options according to your needs. The detailed description is given below.
Name
The field contains new role name as it was set on the previous step.
Owner
The database user or role that is to own the new role. By default, only the owner of an
object can perform various operations with the object. In order to allow other users to
operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Role Type
Defines the role type. Role can be Standard or Application. Unlike standard roles, A
pplication Roles allow the application, rather than SQL Server, to take over the
responsibility of user authentication. However, because SQL Server still must
authenticate the application when it accesses databases, the application must provide a
password because there is no other way to authenticate an application.
Password
For Application roles only. Specifies the password that database users will use to
activate the application role.
Default Schema
For Application roles only. Specifies the first schema that will be searched by the server
when it resolves the names of objects for this role.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The Properties tab allows you to change the role name, the role password and set
statement permissions.
Name
The field allows you to view and modify the role name.
Create Date
Displays the date when the role was created.
Modify Date
Displays the date when the role was last modified.
Role Type
Defines the role type. Role can be standard or application. Unlike standard roles,
application roles allow the application, rather than SQL Server, to take over the
responsibility of user authentication. However, because SQL Server still must
authenticate the application when it accesses databases, the application must provide a
password because there is no other way to authenticate an application.
Password
For Application roles only. Specifies the password that database users will use to
activate the application role.
Default Schema
For Application roles only. Specifies the first schema that will be searched by the server
when it resolves the names of objects for this role.
Statement permissions
You can set statement permissions to the role by selecting essential checkboxes.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
5.24 Files
Microsoft SQL Server maps a database over a set of operating system files. Data and log
information are never mixed in the same file, and individual files are used only by one
database.
New files are created within the File Editor dialog window. In order to
open the dialog you should either
To create a new file with the same properties as one of the existing
files has:
Files can be edited within File Editor. In order to run the editor you
should either
· select the file for editing in the explorer tree (type the first
letters of the file name for quick search);
· select the Edit File ... item from the popup menu
or
· open the database in Database Editor and the Files tab there;
· select the file to edit;
· press the Enter key or select the Edit File item from the popup
menu (alternatively, you may use the corresponding link of the
Navigation Bar).
You can change the name of the file using the Rename File dialog. To
open the dialog you should either
To drop a file:
Files are created and edited within the File Editor window.
File Type
Specifies the file type.
File Name
The field contains the logical name used in SQL Server when referencing the file.
Location
Displays the operating system (physical) file name.
Size
Indicates the file size.
File Group
Specifies the filegroup to which the specified file is added.
File grow
Stands for the automatic growth increment of the file. The FILEGROWTH setting for a file
cannot exceed the MAXSIZE setting.
Comment
The box allows you to set optional text to describe the file.
File groups are created within Create File Group Wizard 210 . In order
to run the wizard you should either
To create a new file group with the same properties as one of the
existing file groups has:
File groups can be edited within File Group Properties. In order to run
the editor you should either
· select the file group for editing in the explorer tree (type the first
letters of the file group name for quick search);
· select the Edit File Group ... item from the popup menu
or
· open the database in Database Editor and the File Groups tab
there;
· select the file group to edit;
· press the Enter key or select the Edit File Group item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the file group using the Rename File
Group dialog. To open the dialog you should either
· open the database in Database Editor and the File Groups tab
there;
· select the file group to rename;
· select the Rename File Group item from the popup menu
(alternatively, you may use the corresponding link of the
Navigation Bar).
To open this dialog, select the File Group Properties item from the popup menu of the
selected object in the explorer tree or double click the object.
On creation you need to set only the new file group Name. The file group name must be
unique among the file group names in the database.
Comment
The field allows you to set optional text to describe the new file group.
5.26 Assemblies
Assemblies are managed application modules that contain classes metadata and
managed code as an object in an instance of SQL Server. By referencing these modules,
common language runtime (CLR) functions, stored procedures, triggers, user-defined
aggregates, and user-defined types can be created in the database.
Note: The object is available only for Microsoft SQL server 2005.
· select the assembly for editing in the explorer tree (type the first
letters of the assembly name for quick search);
· select the Edit Assembly ... item from the popup menu
or
· open the database in Database Editor and the Assemblies tab
there;
· select the assembly to edit;
· press the Enter key or select the Edit Assembly item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
To drop an assembly:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Assembly options
Name
The field contains the assembly name.
Owner
Specifies the name of a user or role as the owner of the assembly. By default, only the
owner of an object can perform various operations with the object. In order to allow other
users to operate it, privileges must be granted. (However, users that have the superuser
attribute can always access any object.)
Comment
This field stores a comment to the assembly.
Location
Specifies the local path or network location where the assembly that is being uploaded is
located, and also the manifest file name that corresponds to the assembly.
Permission Set
Specifies a set of code access permissions that are granted to the assembly when it is
accessed by the SQL Server.
Assembly files
On this step of the wizard you can specify the files of the assembly being created. Use
Insert hot key or pop-up menu to open the Create Assembly File Wizard. The wizard
guides you through the process of new assembly file creating.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
The Files tab displays files belonging to the assembly. Use the corresponding items of
popup menu to add a new assembly file within Create Assembly File Wizard and drop
assembly files.
Location
Uploads a file to be associated with the assembly, such as source code, debug files or
other related information, into the server.
The Classes tab represents the classes metadata as it is written in *.dll files.
The Properties tab allows you to view the assembly name, change the assembly owner,
comment, location, etc.
Name
Here you can view the assembly name.
Owner
Specify the owner of the assembly. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Comment
This field stores a comment to the assembly.
Create Date
Indicates the date when the assembly was created.
Location
Specifies the manifest file name that corresponds to the assembly.
Visibility
Indicates whether the assembly is visible for creating common language runtime (CLR)
functions, stored procedures, triggers, user-defined data types, and user-defined
aggregate functions against it.
Permission Set
Specifies a set of code access permissions that are granted to the assembly when it is
accessed by SQL Server.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Note: The object is available only for Microsoft SQL server 2005.
· select the asymmetric key for editing in the explorer tree (type
the first letters of the asymmetric key name for quick search);
· select the Edit Asymmetric Key ... item from the popup menu
or
· open the database in Database Editor and the Asymmetric Keys
tab there;
· select the asymmetric key to edit;
· press the Enter key or select the Edit Asymmetric Key item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Owner
Specify the owner for the new asymmetric key. By default, only the owner of an object
can perform various operations with the object. In order to allow other users to operate
it, privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Source Type
Defines the asymmetric key source type.
Source
If File or Executable File source type is selected, use this field to specify the path to the
strong-name file from which the key pair is to be loaded or the assembly file from which
the public key is to be loaded.
Assembly
If Assembly source type is selected, use this field to specify the name of the assembly
212 from which the public key is to be loaded. The assembly must have been already
Algorithm
If Generate New source type is selected, you should specify an encryption algorithm in
this field.
If checked, the private key will be encrypted with the database master key. Otherwise
you have to specify password with which the private key will be encrypted.
Password
Specifies the password the private key is to be encrypted with.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify asymmetric key options according to your needs. The detailed description is
given below.
Name
Define a name for the asymmetric key.
Owner
Specify the owner for the asymmetric key. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Algorithm
If Generate New source type is selected, you should specify an encryption algorithm in
this field.
Length
Defines the length of the asymmetric key in bits.
Decryption password
Specifies the old password the private key is currently encrypted with.
Encryption password
Specifies a new password for encrypting the private key.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Note: The object is available only for Microsoft SQL server 2005.
New symmetric keys are created within Create Symmetric Key Wizard
221 . In order to run the wizard you should either
· select the symmetric key for editing in the explorer tree (type
the first letters of the symmetric key name for quick search);
· select the Edit Symmetric Key ... item from the popup menu
or
· open the database in Database Editor and the Symmetric Keys
tab there;
· select the symmetric key to edit;
· press the Enter key or select the Edit Symmetric Key item from
the popup menu (alternatively, you may use the corresponding
link of the Navigation Bar).
To create a new symmetric key with the same properties as one of the existing
symmetric keys has:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
To create a new symmetric key, define the encryption algorithm (possible values: DES,
TRIPLE DES, RC2, RC4, DESX, AES 128, AES 192, AES 256) and specify the symmetric
key encryptions.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify symmetric key options according to your needs. The detailed description is given
below.
The Encryptions tab allows you specify the symmetric key encryptions: create new and
drop existing one. Select the mechanism you wish to be used for the current encryption.
Possible values are Certificate, Password, Symmetric Key, Asymmetric Key.
Name
Define a name for the symmetric key.
Owner
Specify the owner of the symmetric key. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Create Date
Displays the date when symmetric key was created.
Modify Date
Displays the date when symmetric key was last modified.
Algorithm
Defines the encryption algorithm. Possible values are DES, TRIPLE DES, RC2, RC4, DESX,
AES 128, AES 192, AES 256.
Length
Indicates the length of the asymmetric key in bits.
5.29 Certificates
A certificate is a database-level securable that follows the X.509 standard and supports
X.509 V1 fields. You can load a certificate from a file or an assembly 212 , or generate a
key pair and create a self-signed certificate.
Private keys generated by SQL Server are 1024 bits long. Private keys imported from an
external source have a minimum length of 384 bits and a maximum length of 3,456 bits.
The length of an imported private key must be an integer multiple of 64 bits.
The private key must correspond to the public key specified by certificate. When you
create a certificate from a container, loading the private key is optional. But when SQL
Server generates a self-signed certificate, the private key is always created. By default,
the private key is encrypted with the help of the database master key. If the database
master key does not exist and no password is specified, the action will fail.
Note: The object is available only for Microsoft SQL server 2005.
· select the certificate for editing in the explorer tree (type the
first letters of the certificate name for quick search);
· select the Edit Certificate ... item from the popup menu
or
To drop a certificate:
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
Owner
Specify the owner of the certificate. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Source Type
Define the certificate source type.
File
If File or Executable File source type is selected, use this field to specify the complete
path (including the file name) to the certificate or to a file that has been signed by a
certificate. This can be a local path or a UNC path to a network location.
Assembly
If Assembly source type is selected, use this field to specify a signed assembly from
which the certificate will be loaded. The assembly 212 must have been already created in
the database.
Subject
The term "subject" refers to a field in the certificate metadata as defined in the X.509
standard. The subject can be up to 4096 bytes long. Subjects that exceed 4096 bytes
will be truncated when stored in the catalog, but the BLOB containing the certificate will
retain the full subject name.
Decryption Password
Specifies the password for decrypting a private key that is retrieved from a file. You do
not have to specify a decryption password when the private key is encrypted with the
database master key.
Encryption password
Specifies the password that will be used to encrypt the private key that is retrieved
from a file. The option is not required when the private key will be encrypted with the
database master key. Use this option only in case the private key is encrypted with a
password. If no password is specified, the private key of the certificate will be
encrypted using the database master key. Omitting this clause will cause an error if the
master key of the database cannot be opened.
Password
Set the password to encrypt the certificate private key with.
Start Date
The field represents the date when the certificate becomes valid.
Expiry Date
The field represents the date when the certificate expires.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify certificate options according to your needs. The detailed description is given
below.
Name
Define a name for the certificate.
Owner
Specify the owner of the certificate. By default, only the owner of an object can
perform various operations with the object. In order to allow other users to operate it,
privileges must be granted. (However, users that have the superuser attribute can
always access any object.)
Subject
Represents the certificate subject. The term "subject" refers to a field in the certificate
metadata as defined in the X.509 standard. The subject can be up to 4096 bytes long.
Subjects that exceed 4096 bytes will be truncated when stored in the catalog, but the
BLOB containing the certificate will retain the full subject name.
Issuer
Displays the certificate issuer (known as Certificate Authority).
Decryption Password
Specifies the password for decrypting a private key that is retrieved from a file.
Encryption password
Specifies the password to be used for encrypting the private key that is retrieved from a
file.
Start Date
The field indicates the date when the certificate becomes valid.
Expiry Date
The field indicates the date when the certificate expires.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
New DDL Triggers are created within Create DDL Trigger Wizard 229 . In
order to run the wizard you should either
To create a new DDL Trigger with the same properties as one of the
existing DDL Triggers has:
DDL Triggers can be edited within DDL Trigger Editor 230 . In order to
run the editor you should either
· select the DDL Trigger for editing in the explorer tree (type the
first letters of the DDL Trigger name for quick search);
· select the Edit DDL Trigger ... item from the popup menu
or
· open the database in Database Editor and the DDL Triggers tab
there;
· select the DDL Trigger to edit;
· press the Enter key or select the Edit DDL Trigger item from the
popup menu (alternatively, you may use the corresponding link of
the Navigation Bar).
You can change the name of the DDL Trigger using the Rename DDL
Trigger dialog. To open the dialog you should either
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
To create a new DDL Trigger, specify the following options: a comment (optional), the
Enabled option, the security context under which the DDL trigger is to be executed (see
Execute As Clause (Microsoft SQL 2005 References) for details) and the events which
execution cause the DDL trigger to fire.
To add events, use the ellipse button (...) and specify event types and groups in the
Add Event dialog. If an event group is specified, the DDL trigger fires after execution of
any event from this group.
Specify the trigger steps to be executed when the DDL trigger fires as trigger Definition.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify DDL Trigger options according to your needs. The detailed description is given
below.
Definition
The field contains the definition of the DDL trigger. It describes the trigger conditions
and actions. The trigger actions specified in the Transact-SQL statements go into effect
when the DDL operation is tried. Triggers can include any number and kind of Transact-
SQL statements, with exceptions.
Name
Displays the DDL trigger name.
Comment
Specify a comment to the DDL trigger.
Create Date
Indicates the date when the DDL trigger was created.
Modify Date
Indicates the date when the DDL trigger was last modified.
Encrypted
Encrypts the text of the CREATE TRIGGER statement. Using Encrypted prevents the
trigger from being published as part of SQL Server replication.
Execute As
Specifies the security context under which the DDL Trigger is to be executed (For
details see Execute As Clause (Microsoft SQL 2005 References)).
Events
This field allows you to specify the events execution of which causes a DDL trigger to
fire. Click ellipse button (...) on the right of the events text area to select this events or
event groups using the Add Event Dialog.
Enabled
Disabling a trigger does not drop it. The DDL trigger still exists as an object in the
current database/server. However, the DDL trigger does not fire when any Transact-SQL
statements on which it was programmed are executed.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
New CLR DDL Triggers are created within Create CLR DDL Trigger
Wizard. In order to run the wizard you should either
To create a new CLR DDL Trigger with the same properties as one of
the existing CLR DDL Triggers has:
CLR DDL Triggers can be edited within CLR DDL Trigger Editor. In
order to run the editor you should either
· select the CLR DDL Trigger for editing in the explorer tree (type
the first letters of the CLR DDL Trigger name for quick search);
· select the Edit CLR DDL Trigger ... item from the popup menu
or
· open the database in Database Editor and the CLR DDL Triggers
tab there;
· select the CLR DDL Trigger to edit;
· press the Enter key or select the Edit CLR DDL Trigger item from
the popup menu (alternatively, you may use the corresponding
You can change the name of the CLR DDL Trigger using the Rename
CLR DDL Trigger dialog. To open the dialog you should either
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying CLR DDL trigger options 233
This step of the wizard allows you to define CLR DDL trigger options according to your
needs. The detailed description is given below.
Comment
Specify a comment to the CLR DDL trigger.
Execute As
Specifies the security context under which the CLR DDL trigger is to be executed (for
details see Execute As Clause (Microsoft SQL 2005 References)).
Events
This field allows you to specify the events execution of which causes a CLR DDL trigger
to fire. Click the ellipse button (...) to the right from the events text area to select this
event or event group using the Add Event Dialog.
Enabled
Disabling a trigger does not drop it. The CLR DDL trigger still exists as an object in the
current database/server. However, the CLR DDL trigger does not fire when any
Transact-SQL statements on which it was programmed are executed.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing CLR DDL trigger properties 234
Specify CLR DDL trigger options according to your needs. The detailed description is
given below.
Name
Displays CLR DDL trigger name.
Note: the name of the object must be unique among all the object names in
the server. You can use any identifier that is allowed by Microsoft SQL
server.
Comment
Specify a comment to the CLR DDL trigger.
Create Date
Indicates the date when the CLR DDL trigger was created.
Modify Date
Indicates the date when the CLR DDL trigger was last modified.
Execute As
Specifies the security context under which the CLR DDL trigger is to be executed (For
details see Execute As Clause (Microsoft SQL 2005 References)).
Events
This field allows you to specify events the execution of which causes a CLR DDL trigger
to fire. Click ellipse button (...) on the right of the events text area to select this
events or event groups using the Add Event Dialog.
Enabled
Disabling a trigger does not drop it. The CLR DDL trigger still exists as an object in the
current database/server. However, the CLR DDL trigger does not fire when any
Transact-SQL statements on which it was programmed are executed.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
New table types are created within Create Table Type Wizard 236 . In
order to run the wizard you should either
To create a new table type with the same properties as one of the
existing one has:
Table data types can be edited within Table Type Editor 237 . In order
to run the editor you should either
· select the table type for editing in the explorer tree (type the
first letters of the type name for quick search);
· select the Edit Table Type... item from the popup menu
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
First of all set the new table type name. You can also describe the type using the
Comment field.
On the next step specify the table type fields and their properties. Use the pop-up menu
or press Insert to add a new field and set its properties in Field Editor.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
6 Server Objects
With MS SQL Maestro you can accomplish all the popular actions of server
administration. Note that before working with server objects you should connect to any
server database first (see Database Management 22 ).
The following list contains the most common server objects supported by MS SQL
Maestro.
· Databases 241 ;
· Logins 243 ;
· Credentials 299 ;
· Jobs 269 ;
· Alerts 292 ;
· Operators 281 ;
· Backup Devices 261 ;
· Linked servers 305 ;
· Processes 404 ;
· Server Variables 259 .
Below you can find some common ways of server object management.
New server objects are created within the appropriate Create Object
Wizard. In order to run the wizard you should either
· select the server object for editing in the explorer tree (type the
first letters of the object name for quick search);
· select the Edit Object item from the popup menu
or
· open the server in Server Editor and the corresponding objects'
tab there;
· select the server object to edit;
· press the Enter key or select the Edit Object item from the
popup menu (alternatively, you can use the corresponding link of
the Navigation Bar).
To run Server Editor, select the essential server from the Explorer Tree and press Enter,
or use popup menu.
Server Editor consists of several tabs according different kinds of server-scope objects.
Every tab is intended for managing server objects (e.g. databases, logins, server roles,
operators, categories, alerts, jobs, schedules, backup devices, etc.). Any object can be
opened in its editor. The popup menu allows you to create new, edit or drop the
selected server object. Using the popup menu you can also create a copy of the object.
You can operate on several objects at a time. For this you have to select database
objects with the Shift or the Ctrl key pressed. After the group of objects is selected,
you can operate on it, e.g. delete several objects at once, as it were a single object.
6.2 Databases
MS SQL Maestro allows you to manipulate databases by means of database profiles.
Profile contains database connection settings and a set of options to automatize
common manipulations with databases (a possibility to connect to the database at MS
SQL Maestro startup, login prompt before connection, etc.). To start working with
databases in MS SQL Maestro, you should create database profile(s) first.
Use for this purpose Create Database Wizard 33 . In order to run the
wizard you should either
Using Create Database Wizard set the Create profile after creating the
database option to create a new profile and open the Database Profile
Properties dialog after the database is created.
To edit a database:
6.3 Logins
A user passes through two stages of security when working in Microsoft® SQL Server™:
authentication and authorization (permissions validation). The authentication stage
identifies the user by a login account and verifies only the ability to connect to an
instance of SQL Server. If authentication is successful, the user connects to an instance
of SQL Server. The user 199 then needs permissions to access databases on the server
done by granting access to an account in each database mapped to the user login.
To give permissions for changing server objects to a login, you should include the login
into the appropriate server role 256 .
There are four types of logins: Windows Authentication, SQL Server Authentication, and
also Certificate, and Asymmetric Key for Microsoft SQL Server 2005.
· It is also possible to connect using SQL Server Authentication. When a user connects
with a specified login name and password from a nontrusted connection, SQL Server
performs the authentication itself by checking to see if a SQL Server login account has
been set up and whether the specified password matches the one previously recorded.
If SQL Server does not have a login account set, authentication fails and the user
receives an error.
New logins are created within Create Login Wizard 244 . In order to run
the wizard you should either
· select the Logins list or any object from that list and then use
the Create New Login item from the popup menu
or
· open the server in Server Editor and the Logins tab there and
press Insert or select the Create New Login item from the popup
menu (Alternatively, use the corresponding link of the Navigation
Bar).
Logins are edited within Login Editor 251 . In order to open the editor
you should either
· select the login for editing in the explorer tree (type the first
letters of the login name for quick search);
· select the Edit Login item from the popup menu
or
· open the server in Server Editor and the Logins tab there;
· select the login to edit;
· press the Enter key or select the Edit Login item from the popup
menu (alternatively, you can use the corresponding link of the
Navigation Bar).
Note: To view, edit, create or remove SQL Server logins, the connected user
must be a member of the SQL Server securityadmin and sysadmin fixed
server roles. Each member of a fixed server role can add other logins
within the role he belongs to.
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Windows Authentication 245
· SQL Server Authentication 247
· Certificate 248
· Asymmetric Key 250
· Setting login permissions 251
Name
Specify the name of the Microsoft SQL Server login that is being created.
Note: the name of the object must be unique among all the object names in
the server. You can use any identifier that is allowed by Microsoft SQL
server.
In Microsoft SQL server 2005 you can also use Credentials. The name of a credential 299
is to be mapped to the new SQL Server login. A credential is a record containing the
authentication information required for connecting to a resource outside of SQL Server.
The credential must already exist in the server.
Database
Select the default database to be assigned to the login from the drop-down list of
connected databases including the master database.
Language
Specify the default language to be assigned to the login. The default language is set to
the current default language of the server. If the default language of the server is
changed in the future, the default language of the login will remain unchanged.
Domain
Specify the domain to be used to validate the login network security attributes. SQL
Server achieves login security integration with Windows NT 4.0 by using the security
attributes of a network user to control login access. A user's network security attributes
are established at network login time and are validated by a Windows domain controller.
Security Access
If Deny access value is selected, the login is disabled. (up to Microsoft SQL 2005)
Name
Specify the name of the SQL Server login that is being created.
Note: the name of the object must be unique among all the object names in
the server. You can use any identifier that is allowed by Microsoft SQL
server.
In Microsoft SQL server 2005 you can also use Credentials. The name of a credential 299
is to be mapped to the new SQL Server login. A credential is a record containing the
authentication information required for connecting to a resource outside of SQL Server.
The credential must already exist in the server.
Database
Specify the default database to be assigned to the login. The default database is set to
MASTER.
Language
Specify the default language to be assigned to the login. The default language is set to
the current default language of the server. If the default language of the server is
changed in the future, the default language of the login will remain unchanged.
Password
Enter the password according to the server requirements. In Microsoft SQL 2005 this
value may be supplied already hashed when creating SQL Server logins.
The option Hashed is available only in Microsoft SQL 2005. Check it if the password is
already hashed. If this option is not selected, the string entered as password will be
hashed prior to being stored in the database.
This step of the wizard allows you to specify Certificate login options according to your
needs. The detailed description is given below.
Name
Specifies the name of the Certificate login that is being created.
Note: the name of the object must be unique among all the object names in
the server. You can use any identifier that is allowed by Microsoft SQL
server.
Enabled
If checked, the login is enabled.
Credential
Define here the name of a credential 299 to be mapped to the new SQL Server login. A
credential is a record containing the authentication information required for connecting
to a resource outside of SQL Server. The credential must already exist in the server.
Database
Specify the default database to be assigned to the login. The default database is set to
MASTER.
Language
Specify the default language to be assigned to the login. The default language is set to
the current default language of the server. If the default language of the server is
changed in the future, the default language of the login will remain unchanged.
Certificate
Specifies the name of a certificate to be associated with this login. This certificate must
This step of the wizard allows you to specify Asymmetric Key login options according to
your needs. The detailed description is given below.
Name
Specify the name of the Asymmetric Keys login that is created.
Note: the name of the object must be unique among all the object names in
the server. You can use any identifier that is allowed by Microsoft SQL
server.
Enabled
If checked, the login is enabled.
Credential
Define here the name of a credential 299 to be mapped to the new SQL Server login. A
credential is a record containing the authentication information required for connecting
to a resource outside of SQL Server. The credential must already exist in the server.
Database
Specify the default database to be assigned to the login. The default database is set to
MASTER.
Language
Specify the default language to be assigned to the login. The default language is set to
the current default language of the server. If the default language of the server is
changed in the future, the default language of the login will remain unchanged.
Asymmetric Key
Specify the name of an asymmetric key to be associated with this login. This key must
already exist in the master database.
The wizard step allows to define fixed server roles membership for the login being
created and to grant the new login permissions. Just open the corresponding tab and
check the appropriate boxes.
Note: To view, edit, or remove SQL Server logins, the connected user must be
a member of the SQL Server securityadmin and sysadmin fixed server
roles.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
Specify login options according to your needs. The detailed description is given below.
Name
Specify the name of the SQL Server login that is created.
Note: the name of the object must be unique among all the object names in
the server. You can use any identifier that is allowed by Microsoft SQL
server.
Create Date
Modify Date
Displays the date when the login was last modified.
Database
Specify the default database to be assigned to the login. The default database is set to
MASTER.
Language
Specify the default language to be assigned to the login. The default language is set to
the current default language of the server. If the default language of the server is
changed in the future, the default language of the login will remain unchanged.
Type
Specify the type of login authentication. Possible types of authentication are Windows,
SQL Server, Certificate and Asymmetric Key.
Domain
This field is available when the Windows Authentication login type is selected. Specify
the Windows domain.
Password
Applies to SQL Server logins only. Specify the password for the login that is being
created. This value may be supplied already hashed when creating SQL Server logins.
Pre-hashed passwords cannot be used when creating Windows logins.
Applies to SQL Server logins only. If this option is included, SQL Server will prompt the
user for a new password the first time the new login is used.
Server Roles
Define server roles for the login. See Server Roles 256 for details.
Server permissions
Define actions allowed for the login.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Objects having this login as the owner are managed within the Objects tab of Login
Editor. Open an object in the necessary object editor by double-clicking or pressing the
Enter key. Use grid's popup menu to edit, drop or rename objects.
SQL Server provides nine fixed server roles. The permissions that are granted to the
fixed server roles cannot be changed. Beginning with SQL Server 2012, you can create
user-defined server roles and add server-level permissions to the user-defined server
roles.
You can add server-level principals (SQL Server logins, Windows accounts, and Windows
groups) into server-level roles. Each member of a fixed server role can add other logins
to that same role. Members of user-defined server roles cannot add other server
principals to the role.
Note: Fixed server roles are server-wide in their scope. Each member of a fixed
server role can add other logins within the role.
Server roles are edited within Server Roles Editor 257 . In order to run the editor you
should either
· select the server role for editing in the explorer tree (type the first letters of the
server role name for quick search);
· select the Edit Server Role item from the popup menu
or
· open the server in Server Editor and the Server Roles tab there;
· select the server role to edit;
· press the Enter key or select the Edit Server Role item from the popup menu
(alternatively, you can use the corresponding link of the Navigation Bar).
Server Roles Editor allows you to view the logins implemented to the role, include or
exclude existing logins from the definite role.
Note: Members of the securityadmin fixed server role can grant both server-
level and database-level permissions.
The Name and Comment fields represents the server role name and comment
respectively.
Logins
Displays the list of all existing logins. If a login name is checked, the login is added to
the fixed server role.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
See also: Logins 243
Note: Members of the securityadmin fixed server role can grant both server-
level and database-level permissions.
The Name and Comment fields represents the server role name and comment
respectively.
Logins
Displays the list of all existing logins. If a login name is checked, the login is added to
the fixed server role.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Server variables are edited within Server Variable Editor 259 . In order to open the editor
you should either
· select the server variables for editing in the explorer tree (type the first letters of
the server variable name for quick search);
· select the Edit Server Variable item from the popup menu
or
· open the server in Server Editor and the Server Variables tab there;
· select the server variables to edit;
· press the Enter key or select the Edit Server Variable item from the popup menu
(alternatively, you can use the corresponding link of the Navigation Bar).
Note: The value (Integer) of variable must be between Min Value and Max
Value.
Here you can also edit the variable Name, the current Value of the configuration option,
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Creating a logical backup device can simplify backup and restore operations where
specifying the device name is an alternative using a 'tape' or 'disk' clause to specify the
device path.
Problems connected with ownership and permissions can interfere with the use of disks
or file backup devices. Make sure that the appropriate file permissions are given to the
Windows account under which the Database Engine was started.
Note: Creating and editing of Backup Device are required for members of the
diskadmin fixed server role.
New backup devices are created within Create Backup Device Wizard
262 . In order to run the wizard you should either
· select the Backup Devices list or any object from that list and
then use the Create New Backup Device item from the popup
menu
or
· open the server in Server Editor and the Backup Devices tab
there and press Insert or select the Create New Backup Device
item from the popup menu (Alternatively, use the corresponding
link of the Navigation Bar).
Backup devices are edited within Backup Device Editor 263 . In order to
open the editor you should either
· select the backup device for editing in the explorer tree (type
the first letters of the backup device name for quick search);
· select the Edit Backup Device item from the popup menu
or
· open the server in Server Editor and the Backup Devices tab
there;
· select the backup device to edit;
· press the Enter key or select the Edit Backup Device item from
the popup menu (alternatively, you can use the corresponding
link of the Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying backup device options 288
This step of the wizard allows you to select Device Type from the drop-down list. The
available values: disk, tape or pipe. Enter the physical name of the backup device in the
File Name field. Physical names must follow the rules for operating-system file names or
universal naming conventions for network devices and must include the full path. If you
add a tape device, this parameter must be the physical name assigned to the local tape
device by Windows; for example, \\.\TAPE0 for the first tape device on the computer.
The tape device must be attached to the server computer; it cannot be used remotely.
The names containing nonalphanumeric characters are to be enclosed in quotation
marks.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Viewing backup device properties 264
Within the Properties tab you can find logical Name and the physical File Name of the
backup device, Device Type.
To view backup media properties such as Name, Sequence and Description, use the
Show Contents link of the Navigation bar.
The tab is also designed for convenient backup review on this device. The backups are
displayed in the Contents grid. Use the Show Contents link of the Navigation bar. Using
the grid you can filter and sort the backups by Name, Server, Database, Type, Date,
Comment, Expiration and Size.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
6.7 Schedules
Scheduling administrative jobs 269 means defining the condition(s) that cause the job to
begin running. Using these server objects you can schedule any type of job. The same
job schedule can be used by more than one job. A user can attach and detach
schedules from jobs. The object is available in Microsoft SQL server 2005 or higher.
Only one instance of the job can be run at a certain moment. If you try to run a job
manually while it is running as scheduled, SQL Server Agent refuses the request.
To prevent a scheduled job from running, you should either disable the schedule using
the corresponding option of the Schedule Editor dialog window, or disable the job using
Job Editor, drop the schedule using the Drop Schedule item of the popup menu in the
Available Schedules field of Job Editor, or stop the SQLSERVERAGENT service on the
server. When a job schedule is not enabled, the schedule is not enabled for any job that
uses the schedule.
You must explicitly re-enable a schedule that has been disabled.
Note: Jobs can only run when the SQLSERVERAGENT service is currently
running on the server.
· select the Schedules list or any object from that list and then
use the Create New Schedule item from the popup menu
or
· open the server in Server Editor and the Schedules tab there and
press Insert or select the Create New Schedule item from the
popup menu (Alternatively, use the corresponding link of the
Navigation Bar).
Schedules are edited within Schedule Editor 267 . In order to open the
editor you should either
· select the schedule for editing in the explorer tree (type the first
letters of the schedule name for quick search);
· select the Edit Schedule item from the popup menu
or
· open the server in Server Editor and the Schedules tab there;
· select the schedule to edit;
· press the Enter key or select the Edit Schedule item from the
popup menu (alternatively, you can use the corresponding link of
the Navigation Bar).
Note: If the schedule is disabled editing the schedule does not automatically
re-enable the schedule.
Name
The field stores the name of the schedule.
Enabled
The option indicates the current status of the schedule. If not checked, the schedule is
not enabled. When the schedule is not enabled, no jobs will run according to this
schedule.
Type
Specifies when a job is to be executed.
· Click Start whenever the CPUs become idle to start the job when the CPUs reach an
idle condition.
· Click Recurring if you want a schedule to run repeatedly. To set the recurring
schedule, complete the Frequency, Daily Frequency, and Duration groups on the
dialog.
· Click One time if you want the schedule to run only once. To set the One time
schedule, complete the One-time occurrence group on the dialog.
On date
For the One time schedule type, defines the date when the job is to be executed.
At time
For the One time schedule type, defines the time when the job is to be executed.
Recurring
Defines time tunings for schedule when the Recurring schedule type is selected.
6.8 Jobs
The job object exposes the attributes of a single SQL Server Agent job. Using SQL
Server Agent jobs, you can automate administrative tasks and run them on a recurring
basis. You can run a job manually or schedule it to run in response to schedules 266 and
alerts 292 . Jobs can be written to run on the local instance of Microsoft SQL or on
multiple servers. To run jobs on multiple servers, you must set up at least one master
server and one or more target servers.
Anyone can create a job, but a job can be edited only by its owner or members of the
sysadmin role.
Only one instance of the job can be run at a time. If you try to run a job manually while
it is running as scheduled, SQL Server Agent refuses the request.
To prevent a scheduled job from running, you should either disable the schedule using
the corresponding option of the Schedule Editor dialog window, or disable the job using
Job Editor, drop the schedule using the Drop Schedule item of the popup menu in the
Available Schedules field of Job Editor, or stop the SQLSERVERAGENT service on the
server.
Note: Before starting a job make sure that the SQLSERVERAGENT service is
currently running on the server.
New jobs are created within Create Job Wizard 270 . In order to run
this wizard you should either
· select the Jobs list or any object from that list and then use the
Create New Job item from the popup menu
or
· open the server in Server Editor and the Jobs tab there and
press Insert or select the Create New Job item from the popup
menu (Alternatively, use the corresponding link of the Navigation
Bar).
Jobs are edited within Job Editor 276 . In order to open the editor you
should either
· select the job for editing in the explorer tree (type the first
letters of the job name for quick search);
· select the Edit Job item from the popup menu
or
· open the server in Server Editor and the Jobs tab there;
· select the job to edit;
· press the Enter key or select the Edit Job item from the popup
menu (alternatively, you can use the corresponding link of the
Navigation Bar).
A job step is an action that the job takes on a database or a server. Every job must
have at least one job step. Job steps can be operating system commands, Transact-
SQL statements, Microsoft® ActiveX® scripts, or replication tasks.
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying job options 271
· Managing job steps 272
Specify job options according to your needs. The detailed description is given below.
Owner
Define the owner of the job.
Comment
Specify a comment to the job (optional).
Enabled
Indicates the status of the added job. If not checked, the job is not enabled and does
not run according to its schedule; however, it can be run manually.
Category
The category for the job. See Categories 287 for details.
E-mail Operator
Name
Set the e-mail name to send e-mail notifications upon job execution (optional).
Notify
Select the condition under which the e-mail notification is to be sent: Never (set by
default), when the job succeeds, when the job fails, whenever the job completes.
Page Operator
Name
Set the page operator name to send notifications upon job execution (optional).
Notify
Select the condition under which the notification is to be performed: Never (set by
default), when the job succeeds, when the job fails, whenever the job completes.
Notify
Select the condition under which the notification is to be performed: Never (set by
default), when the job succeeds, when the job fails, whenever the job completes.
On this step of the wizard you can specify the subobjects of the job being created.
To add a new object:
· Choose a necessary page (Job Steps - to specify job steps, Schedulers - to set
the condition(s) that cause the job to begin running);
· Using pop-up menu open the appropriate Create Object Wizard;
· Specify new object properties.Click the Add button to add a new step for a job
and set its properties in Create Step Wizard 273 . Click the Edit and Delete buttons
to edit or delete the selected step.
Create Step Wizard guides you through the process of building the initial step and
setting its properties.
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying step options 274
· Specifying job step definition 275
Specify job step options according to your needs. The detailed description is given
below.
Name
The name of the job step.
Type
The field refers to the subsystem used by Microsoft SQL Server Agent service to
execute commands.
Database
The name of the database in which a Transact-SQL step is to be executed.
Language
For an ActiveX job step, the field represents the name of the scripting language that the
step uses.
Language Name
For an ActiveX job step, the field represents the name of the scripting language that the
step uses if Language is selected as Other.
Exit Code
The value returned by a CmdExec subsystem command to indicate that command
executed successfully.
On Success Action
On Failure Action
Specify the action to be performed if the step fails.
Retry Attempts
The number of retry attempts to use if the step fails.
Output File
The name of the file in which the output of this step is saved. This parameter is valid
only with commands running on the Transact-SQL or CmdExec subsystems.
Write To History
Write Transact-SQL job step output to step history (Transact-SQL job steps only).
User Name
The name of the user account to use when executing a TSQL step.
6.8.1.3.2 Specifying job step definition
At this step you can specify the SQL definition for the new job step. The step is
optional: you can do it later using a non-modal editor.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing job properties 277
The Properties tab is provided for managing general job options. There are Steps,
Schedules and Properties parts there.
The Steps tab displays the job steps. Use Step Editor 279 for editing the step. The popup
menu of this tab allows you to create a new step, edit, drop or rename the existing
steps.
The Schedules grid allows you to define the condition(s) that cause the job to begin
running. Just select a job schedule to edit and use Schedule Editor for editing the
schedule. The popup menu of the selected schedule allows you to attach available
schedules to the current job, detach schedule, create, edit, drop or rename schedules.
For more information see Schedules 266 .
All the job common properties are available for editing on the bottom of the Properties
window. Here you can modify the job's name, owner, and the comment to the job.
The Create Date field indicates the date when job was created.
The Modify Date field indicates the date when job was last modified.
Next Run Schedule indicates the specific date of the next job running.
You can also find here the job status, the last job run date, and the next job run date
The Version box contains the version of the job (automatically updated each time the
job is modified).
Enabled indicates the status of the added job. If not checked, the job is not enabled and
does not run according to its schedule; however, it can be run manually.
Category represents the job category. See Categories 287 for details.
E-mail Operator
Name
The e-mail of the person to send e-mail to when email_level is reached.
Notify
A value that indicates when an e-mail upon the completion of this job is to be sent.
Page Operator
Name
The name of the operator to whom the network message is sent upon completion of this
job.
Notify
A value that indicates when a network message upon the completion of this job is to be
sent.
Notify
A value that indicates when a page upon the completion of this job is to be sent.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
Job Step Editor allows you to edit step properties, its dependences, view the Transact-
SQL statement for creating the step, etc. It can be opened automatically when you
create a new job or edit the existing one.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing step properties 279
Specify job options according to your needs. The detailed description is given below.
Command
Specify the commands to be executed by SQLServerAgent service through subsystem.
Name
The field contains the name of the step.
Type
The field refers to the subsystem used by Microsoft SQL Server Agent service to
execute commands.
Database
The name of the database in which a Transact-SQL step is to be executed.
Language
For an ActiveX job step, the field represents the name of the scripting language that the
step uses.
Language Name
For an ActiveX job step, it is the name of the scripting language that the step uses if
Language is selected as Other.
Exit Code
The value returned by a CmdExec subsystem command to indicate that the command
executed successfully.
On Success Action
Specify the action to be performed if the step succeeds.
On Failure Action
Specify the action to be performed if the step fails.
Retry Attempts
Specify the number of retry attempts to use if this step fails.
Output File
Set the name of the file in which the output of this step is saved. This parameter is valid
only with commands running on the Transact-SQL or CmdExec subsystems.
Write To History
Write Transact-SQL job step output to step history (Transact-SQL job steps only).
User Name
The name of the user account to use when executing a TSQL step.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
6.9 Operators
An operator is notification recipient that is used with alerts 292 and jobs 269 .
Note: Before starting a job make sure that the SQLSERVERAGENT service is
currently running on the server.
· select the Operators list or any object from that list and then use
the Create New Operator item from the popup menu
or
· open the server in Server Editor and the Operators tab there and
press Insert or select the Create New Operator item from the
popup menu (Alternatively, use the corresponding link of the
Navigation Bar).
Operators are edited within Operator Editor 284 . In order to open the
editor you should either
· select the operator for editing in the explorer tree (type the first
letters of the operator name for quick search);
· select the Edit Operator item from the popup menu
or
· open the server in Server Editor and the Operators tab there;
· select the operator to edit;
· press the Enter key or select the Edit Operator item from the
popup menu (alternatively, you can use the corresponding link of
the Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying operator options 282
· Managing operator notifications 284
Specify operator options according to your needs. The detailed description is given
below.
Enabled
Indicates the current status of the operator. If not checked, the operator is not enabled
and does not receive notifications.
Category
Defines the name of the category for this operator. See Categories 287 for details.
E-mail Address
Defines the e-mail address of the operator.
Pager Address
Defines the pager address of the operator.
The wizard step is provided for your convenient setting of alert notifications for the
operator being created. The grid represents all the available server alerts. Just check
necessary boxes to assign alert and type of notification.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing operator properties 285
Name
Edit the operator name in the field.
Enabled
Indicates the current status of the operator. If not checked, the operator is not enabled
and does not receive notifications.
Category
You can change the name of the category for this operator. See Categories 287 for
details.
Use the E-mail Address, Net Send Address, and Pager Address to re-define the e-mail
address, the network address, and the pager address of the operator.
Notifications
Alerts
The Alerts tab displays all server alerts as a grid. Select the necessary alert, then press
Enter or select the Edit... item from the popup menu or open Alert Editor 295 . Use grid's
popup menu to edit, copy the selected alerts. You can operate on several alerts at a
time. For this you have to select alerts with the Shift or the Ctrl key pressed. After the
objects group is selected, you can operate on it as it was a single object. You can
specify E-mail, Pager or/and Net notification methods by which the operator is notified
when the alert occurs.
Jobs
The Jobs tab displays all server jobs that have this operator as recipient of e-mail, page
or net send notification messages. Select the necessary job, then press Enter or select
the Edit... item from the popup menu or open Job Editor 276 . Use grid's popup menu to
edit, copy the selected alerts. You can operate on several alerts at a time. For this you
have to select alerts with the Shift or the Ctrl key pressed. After the objects group is
selected, you can operate on it as it was a single object.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
6.10 Categories
The Category object represents the attributes of a SQL Server Agent alert 292 category,
job 269 category or operator 281 category.
Microsoft SQL Server provides categories to help you organize your jobs, alerts and
operators for easy filtering and grouping. For example, you can organize all your
database backup jobs in the Database Maintenance category. You can also create your
own categories. Multiserver categories exist only on a master server. There is only one
default job category available only on a master server: [Uncategorized (Multi-Server)].
· select the Categories list or any object from that list and then
use the Create New Category item from the popup menu
or
· open the server in Server Editor and the Categories tab there
and press Insert or select the Create New Category item from
the popup menu (Alternatively, use the corresponding link of the
Navigation Bar).
Categories are edited within Category Editor 289 . In order to open the
editor you should either
· select the category for editing in the explorer tree (type the first
letters of the category name for quick search);
· select the Edit Category item from the popup menu
or
· open the server in Server Editor and the Categories tab there;
· select the category to edit;
· press the Enter key or select the Edit Category item from the
popup menu (alternatively, you can use the corresponding link of
the Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying category options 288
Specify category options according to your needs. The detailed description is given
below.
Name
Set the name for the new category. Bear in mind that the name must be unique within
the specified class.
Class
Select the class of the category out of the following values: Job (adds a job category,
set by default), Alert (adds an alert category), Operator (adds an operator category).
Type
Select the type of the category out of the following values: Local (a local job category,
set by default), Multi-Server (a multiserver job category).
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing category properties 290
Specify the category options according to your needs. The detailed description is given
below.
Name
Set the name of the category. Bear in mind that the name must be unique within the
specified class.
Class
Select the class of the category out of the following values: Job (adds a job category,
set by default), Alert (adds an alert category), Operator (adds an operator category).
Type
Select the type of the category out of the following values: Local (a local job category,
set by default), Multi-Server (a multiserver job category), None (a category for a class
other than JOB).
Alerts 292 , jobs 269 or operators 281 that are connected to the current category are
managed in the Operators/Jobs/Alerts in this category list.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
6.11 Alerts
The Alert object represents a single SQL Server Agent alert. Alerts respond to either
specific Microsoft SQL Server error messages or SQL Server errors of a specified
severity. By default, only members of the sysadmin fixed server role can create alerts.
Note: Before starting a job make sure that the SQL Server Agent service
currently running on the server.
New alerts are created within Create Alert Wizard 293 . In order to run
this wizard you should either
· select the Alerts list or any object from that list and then use the
Create New Alert item from the popup menu
or
· open the server in Server Editor and the Alerts tab there and
press Insert or select the Create New Alert item from the popup
menu (Alternatively, use the corresponding link of the Navigation
Bar).
Alerts are edited within Alert Editor 295 . In order to open the editor
you should either
· select the alert for editing in the explorer tree (type the first
letters of the alert name for quick search);
· select the Edit Alert item from the popup menu
or
· open the server in Server Editor and the Alerts tab there;
· select the alert to edit;
· press the Enter key or select the Edit Alert item from the popup
menu (alternatively, you can use the corresponding link of the
Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying alert options 293
· Setting operator the alert to give notify of 295
Category
Define here the name of the alert category. See Categories 287 for details.
Type
Describe the type of the alert in this field. Possible variants are: SQL Server event alert
and SQL server performance condition alert.
Definition Type
This field is available when the SQL Server event alert type is selected. Indicates the
definition type of SQL Server event alert.
Error Number
This field is available when the Error Number definition type is selected. Shows the
message error number that defines the alert.
Message Template
The field displays the explanation of the error with placeholders for parameters.
Severity
This field is available when the Severity definition type is selected. Defines the severity
level (from 1 through 25) that defines the alert.
Database Name
The database in which the error must occur for the alert to fire. If no database is
supplied, the alert fires regardless of where the error occurred.
Event Keyword
The sequence of characters that the description of the SQL Server error must be like.
Transact-SQL LIKE expression pattern-matching characters can be used. the maximum
size of this field is 100. This parameter is useful for filtering object names (for example,
%customer_table%).
Object
This field is available when the SQL Server performance condition alert type is selected.
A performance object used in performance condition.
Counter
This field is available when the SQL Server performance condition alert type is selected.
A performance counter used in performance condition.
Instance
This field is available when the SQL Server performance condition alert type is selected.
A named instance of the counter used in performance condition.
Condition
This field is available when the SQL Server performance condition alert type is selected.
Defines comparator in performance condition.
Value
This field is available when the SQL Server performance condition alert type is selected.
Numeric value of the counter.
Enabled
Indicates the current status of the alert. If unchecked, the alert is not enabled and
does not fire.
Job
The name of the job to be executed in response to this alert.
message. Can have one or more of values (None, E-mail, Pager, Net send) combined
with an OR logical operator.
Notification Message
Is an optional additional message sent to the operator as part of the e-mail, net send,
or pager notification.
Minutes
The delay period, in minutes, between responses to the alert.
Seconds
The delay period, in seconds, between responses to the alert.
The wizard step is provided for your convenient setting of operator notifications for the
alert being created. The grid represents all the available server operators. Just check
necessary boxes to assign operator and type of notification.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
Operator notifications
The grid represents all the available server operators. Check necessary box to assign
operator the alert to give notice of and the type of notification.
Properties
Name
Here you can edit the name of the alert.
Category
Defines the name of the alert category. See Categories 287 for details.
Type
Describes the type of the alert. Possible variants are: SQL Server event alert and SQL
server performance condition alert.
Definition Type
This field is available when the SQL Server event alert type is selected. Indicates the
definition type of SQL Server event alert.
Error Number
This field is available when the Error Number definition type is selected. Shows the
message error number that defines the alert.
Message Template
Shows explanation of the error with placeholders for parameters.
Severity
This field is available when the Severity definition type is selected. Defines the severity
level (from 1 through 25) that defines the alert.
Database Name
The database in which the error must occur for the alert to fire. If database is not
supplied, the alert fires regardless of where the error occurred.
Event Keyword
The sequence of characters that the description of the SQL Server error must be like.
Transact-SQL LIKE expression pattern-matching characters can be used. the maximum
size of this field is 100. This parameter is useful for filtering object names (for example,
%customer_table%).
Object
This field is available when the SQL Server performance condition alert type is selected.
A performance object used in performance condition.
Counter
This field is available when the SQL Server performance condition alert type is selected.
A performance counter used in performance condition.
Instance
This field is available when the SQL Server performance condition alert type is selected.
A named instance of the counter used in performance condition.
Condition
This field is available when the SQL Server performance condition alert type is selected.
Defines comparator in performance condition.
Value
This field is available when the SQL Server performance condition alert type is selected.
Numeric value of the counter.
Enabled
Indicates the current status of the alert. If unchecked, the alert is not enabled and
does not fire.
Job
The name of the job to be executed in response to this alert.
Notification Message
Is an optional additional message sent to the operator as part of the e-mail, net send,
or pager notification.
Minutes
The delay period, in minutes, between responses to the alert.
Seconds
The delay period, in seconds, between responses to the alert.
Last Occurred
Shows the last date when the alert has been occurred.
Last Responded
Displays the date when the alert has last raised response.
Occurrence count
Displays the amount of alert occurrences.
Notifications
This tab displays all server operators as a grid. Select the necessary notification, then
press Enter or select the Edit... item from the popup menu or open Operator Editor 284 .
Use grid's popup menu to edit, copy the selected operators.
You can manage several operators at a time. For this you have to select operators with
the Shift or the Ctrl key pressed. After the objects group is selected, you can operate
on it as if it were a single object. Using the checkboxes you can specify the method by
which the operator is notified (E-mail, Pager or/and Net send) when the alert occurs.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
6.12 Credentials
Credentials allow users that connect to Microsoft SQL Server using SQL Authentication
to connect to Windows or other resources outside of SQL Server. A credential is a
record containing the authentication information needed to connect to a resource
outside of SQL Server. Most credentials consist of a Windows user login name and
password. In Windows 2003 Server and above, the password may not be required. This
server object is available since Microsoft SQL 2005.
After creating a credential, you can map it to a SQL Server login with Create Login
Wizard 244 or Login Editor 251 .
Note: A single credential can be mapped to multiple SQL Server logins. But a
SQL Server login can be mapped to only one credential.
· select the Credentials list or any object from that list and then
use the Create New Credential item from the popup menu
or
· open the server in Server Editor and the Credentials tab there
and press Insert or select the Create New Credential item from
the popup menu (Alternatively, use the corresponding link of the
Navigation Bar).
· select the credential for editing in the explorer tree (type the
first letters of the credential name for quick search);
· select the Edit Credential item from the popup menu
or
· open the server in Server Editor and the Credentials tab there;
· select the credential to edit;
· press the Enter key or select the Edit Credential item from the
popup menu (alternatively, you can use the corresponding link of
the Navigation Bar).
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
· Specifying credential options 300
Specify credential options according to your needs. The detailed description is given
below.
Identity
Specifies the name of the account to be used when connecting outside the server.
Secret
Supplies the secret needed for outgoing authentication. The secret field is optional.
When Identity field is a Windows account, the secret may be the password. In
Windows Server 2003 and above the field is optional.
The basic principles of Object Editors in MS SQL Maestro are considered in the
corresponding topic 47 . See below to find the description of editor tabs that are unique
to the current object.
· Editing credential properties 302
Name
Displays credential name.
Create Date
Displays the date when the credential was created.
Modify Date
Displays the date when the credential was last modified.
Identity
Specifies the name of the account to be used when connecting outside the server.
Secret
Supplies the secret needed for outgoing authentication. The secret field is optional.
When Identity field is a Windows account, the secret may be the password. On
Windows Server 2003 and above the secret is not necessary.
To apply the changes, select the Apply Changes item in the Navigation bar or use Ctrl
+F9 or Ctrl+F7 shortcut keys.
It is also possible to modify object properties without opening the object editor: use the
Object Properties item of the popup menu of the selected object from the explorer tree.
New linked servers are added within Create Linked Server Wizard 306 .
In order to run the wizard you should either
· select the Linked Servers list or any object from that list in the
explorer tree;
· select the Create New Linked Server... item from the popup menu
To create a new linked server with the same properties as one of the
existing one has:
Along with using distributed queries at SQL Editor and SQL Script
Editor, Linked Server Editor 307 allows you to browse data of the
linked server. In order to run the editor you should either
· select the linked server for editing in the explorer tree (type the
first letters of the server name for quick search);
· select the Edit Linked Server... item from the popup menu
The basic principles of Create Object Wizards in MS SQL Maestro are covered by the
corresponding topic 44 . See below to find the description of wizard steps that are unique
to the current object.
The wizard consists of two steps. Register the connection information and data source
information with SQL Server on the first step.
Set the new remote server name. It is the name by which the linked server is known
within this database.
Provider
Select the provider that corresponds to the data source from the drop-down list of
available providers. Note, to work with a database, first of all you need to have the
corresponding ODBC driver/OLE DB provider installed on the same PC as your SQL Server.
Product name
Set here the name of the OLE DB data source to add as a linked server. If SQL Server is
specified, Provider, Data source, Location, Provider string, and Catalog do not have to
be specified.
Data source is the name of the data source as it is interpreted by the OLE DB provider.
Provider string is the connection string that identifies a unique data source. To learn more
about ODBC drivers, OLE DB Providers and other such stuff, read our brief guide to
connection strings.
Catalog is the catalog to be used when a connection is made to the OLE DB provider.
When the linked server is defined against an instance of SQL Server, catalog refers to the
default database to which the linked server is mapped.
The second wizard step allows you to set up remote logins 307 to connect to the linked
server.
To emulate the current security credentials of the login, check the Use self credential
checkbox.
Remote login specifies the username used to connect to the linked server.
7 Queries
MS SQL Maestro provides several tools for working with SQL queries:
· SQL Editor 311 for editing the query text directly and executing SELECT queries;
· Visual Query Builder 316 for building SELECT, INSERT, UPDATE and DELETE queries
visually;
· SQL Script Editor 362 for executing SQL scripts.
Both SQL Editor and Visual Query Builder supports parameters in queries 315
Save frequently used queries to profiles and manage them in the same way as if they
were database objects. This means that you can view queries in the explorer tree, in
Object Manager and Object Browser, use them in BLOB Viewer and Diagram Viewer,
perform drag-and-drop operation upon them, and copy them to clipboard like you copy
an object.
· to save the query to profile, use the Save to profile link from the
Navigation bar.
· to save the current query to an *.sql file, select the Save to file
item from the Navigation bar;
· to save all the opened queries to one file, select the Save all
queries item from the Navigation bar;
· to save the designed diagram, select the Save diagram item from
the Navigation bar of the Diagram tab of Visual Query Builder.
You can open the query directly from the Explorer tree with a double
click or using popup menu. By default it will be opened in SQL Editor.
To edit a query from file, open SQL Editor (the Tools | SQL Editor
main menu item) and use Load From File from the Navigation Bar of
SQL Editor to load a query from an *.sql file.
To edit a query in Query Builder, open the builder (the Tools | Visual
Query Builder main menu item) and then perform one of the following
operations:
· to edit a query from a profile, drag it from the Explorer and drop
on the Editor tab;
· to load a query from an *.sql file, open the Editor tab and select
the Load query item from the Navigation Bar .
On the Query Builder opening the Diagram tab contains the last
edited query.
To execute a query:
To use the editor for working with several queries, open new query tab with the Create
new query link on the Navigation bar. With the tabs’ popup menu you can create a new
query, close existing one, save the query to profile, etc even if editor's navigation bar is
closed. Queries' tabs can been 429 displayed at the all sides of the editor (bottom, top,
left or right).
For more information about query executing and working with query result see the
corresponding topic 313 .
The popup menu of the editing area provides you with standard operations for
working with text such as Cut (Ctrl+X), Copy (Ctrl+C), Paste (Ctrl +V), Undo (Ctrl
+Z), Redo (Shift+Ctrl+Z) along with a possibility to convert selected text to
different cases (lower, UPPER, and NameCase).
SQL Editor allows you to use Visual Query Builder 316 modal instance to design query
visually and load the result query text directly in the editor area. For this purpose
use the Design query link of the editor area's popup menu.
Code completion
MS SQL Maestro provides you with code completion (as on the screen below) to
select from a list of tables, columns, views, or other objects without having to
manually enter the object's name in the editor. You can activate the completion list
by pressing the Ctrl+Space key combination.
Syntax highlighting
Database objects are highlighted in the text. You can open the proper object editor
by clicking the object name in the text with the Ctrl key pressed or with the Find
Object link on the Navigation bar. To adjust the highlighting settings, use SQL
highlight options 449 .
Lines of code that have been edited during the current session are indicated with a
yellow line in the left margin of the editor. When you save the file, the yellow
markers turn green. Thus at any time, yellow markers show changed but unsaved
lines of code, and green markers show changes in this session that have been
saved.
Use find and replace to search for, and optionally, replace text in the SQL Editor. To
open Find text/Replace text window, use Edit | Find/Replace main menu item,
corresponding link of popup menu, or Ctrl+F/Ctrl+H shortcut. You can also use the
Search again link to apply recent Find text dialog.
To load query from .sql file, use the corresponding link on the Navigation bar. You
can also find there links allowing you to save query text to file, export the contents
of the editor to RTF and HTML formats (to file or to clipboard), copy the selected
text from to clipboard as a ready-to-use string written in one of the following
programming languages: C#, C++, Delphi (Object Pascal), and Java, and also print/
preview the contents of the editor.
See also: Visual Query Builder 316 , SQL Script Editor, SQL Editor Options 429
The following options allows you to tune up SQL scripts according to your preferences.
· To execute all statements of the text area with result data, click the Execute
query item of the Navigation bar or use F5, F8, or F9 shortcuts. Statements of
each tab of SQL Editor are executed together in a separate thread in order to
continue your work with the software while the query is executing.
· You can also execute query as script (Shift+F5, Shift+F8, Shift+F9). In this
case the query does not return data.
· To execute only a selected part of the query text, use Execute selected only or
the Alt+F5, Alt+F8, Alt+F9 shortcuts.
· There is also a possibility to execute a statement at the cursor position. For this
purpose, use the Execute at cursor link at the Navigation bar or use the Ctrl+F5,
Ctrl+F8, or Ctrl+F9 shortcuts.
If the query text is correct, the query is executed, and if the query statement is
supposed to return data (e.g. SELECT statement), the Result tab opens with the data
returned by the query. If an error occurs while executing the query, execution stop is
stopped and the appropriate error message is displayed in the Information tab.
The Result area displays the result data in grid. All principles of working with data you
can find in Data Management 325 section.
The Parameters dialog is used to specify the query parameters as well as values of the
input parameters of procedures or functions before the execution. Enter parameter
values and click the OK button to apply the values and execute the query or use the
Cancel button to abort the execution.
Note: To allow use parameters in query text, check the corresponding option
at the Tools 426 tab of MS SQL Maestro Options.
The most popular query management actions (creating, editing, deleting) are covered by
the corresponding topic 309 .
The builder also allows you to create a view based on the prepared query. For this
purpose after the query creating and possibly testing use the Create view from SQL link
at the Navigation bar to invoke the corresponding window, and specify view properties
107 .
See also: SQL Editor 311 , Visual Query Builder Options 431 , Query Parameters 315
The Query Explorer field occupies the left side of Visual Query Builder main window. All
the queries included in the result query (unions, subqueries) are represented at the
Query Explorer for prompt access. They are grouped by kind and listed under the
according node.
- Select the statement type from the drop-down list at the top of the Diagram tab (
SELECT, INSERT, UPDATE, DELETE).
Use the Add Table(s) link of the area popup menu and select tables from the opened
window (Use Ctrl or Shift pressed to select several tables).
To add only one table, simply drag it from the Database Explorer or from Object
Manager/Browser to the Diagram area.
To remove the object, close its window or select the object and press the Delete
key.
To include a table field to the query, tick off the option box to the left of the field
name in the list or double-click it to see the blue icon next to the field name.
To include all the table fields, tick off the option box to the left of the table caption.
In case none fields is included, the SQL statement is generated as SELECT * FROM
<Table_Name>, i.e. all the fields are selected.
To remove the fields from the query, uncheck the corresponding boxes.
Visual Query Builder supports INNER JOIN, LEFT OUTER JOIN, and RIGHT OUTER JOIN.
To associate database objects by two fields, drag a field from the first object's field
list to a field from another object's field list. This will set a link between these
objects by the selected fields. After you finish dragging, a line will appear between
the linked fields. By default INNER JOIN syntax will be used.
You can view the properties of the object association from the query tab directly.
Just set the cursor to the link line. A hint containing the association condition will
appear.
To edit the properties, select the Properties item from the popup menu. A dialog
window will appear, there you can change the association condition by selecting it
from the list (=, >, <, >=, <=, <>). To create LEFT OUTER JOIN / RIGHT OUTER
JOIN statements, check All rows from first_table/All rows from second_table from
the window.
To remove a link between objects, select the Delete Link item from the popup menu.
To delete all the links of an object, click the '-' button next to the object alias. To
insert a point to the link line, select the Insert Point item from the popup menu, and
the new point will appear. Using the point you can move the link line. It does not
cause any changes in the query but makes the diagram performance vivid and the
visual building more obvious.
Criteria tab allows you to set the selection conditions. To add a condition, click the
button on the left and select the Add condition item in the popup menu. Edit the
condition by clicking its parts and setting their values. Clicking the button to the left
of the condition string activates the popup menu which allows you to add a new
condition of the same enclosure level, add a new enclosure level, delete the current
condition, open or close the condition if it is composite.
This function allows you to choose a field from the list of all the table fields available
in the query. The popup menu of the condition field allows you to specify the
condition you need. The way of proceeding the condition is set in the upper string
of the area (All, Any, None, or Not all of the following are possible variants). Click
the underlined word to modify it.
You can add one or more subqueries to further limit the tables and records returned
from a SELECT statement when setting a WHERE condition in the query builder. To
add subquery:
- open Criteria tab;
- click the button on the left and select the Add condition item in the popup menu;
- right click on an argument field and use the Insert query link of the popup menu;
- build the subquery in the new query tab that have appeared in the Diagram area,
or
- open Selection tab;
- use the Insert query link of the popup menu;
- build the subquery in the new query tab that have appeared in the Diagram area.
You can set/edit the object alias directly from the query tab by double-clicking the
object caption.
In case the alias is used as the expression's column name use the Selection tab displays
the output fields of the query. It allows you to edit the names of the query or CASE
output fields, set their displaying order and set the aggregate functions (SUM, MIN, MAX,
AVG, etc.) for each field.
To remove the field from the list, select the Delete current row item from the popup
menu of the field row.
To modify the input query field, double-click it and then type the field name or select one
from the drop-down list.
To modify the output query field name, double-click it and enter the field name.
DISTINCT option
To specify removal of duplicate rows from the result set, open the Selection tab and
check the Select only unique records box.
Set the conditions to be included into the HAVING statement within the Grouping
Criteria tab. They are set in the same way as the WHERE conditions. To set the
aggregate function for the field, double-click the field row in the Aggregate column
and then type the function name or select one from the drop-down list.
ORDER BY clause
Set the way of sorting the query records within the Sorting tab. The field list on the
left represents all the output query fields; the list on the right contains fields by
which the query records will be sorted. To move the field from one list to another,
drag the selected field or use the Add and Remove buttons. To change the sorting
order, select a field in the right list and move it using the Up and Down buttons.
To change the sorting direction, select a filed in the right list and switch the
direction (Ascending, Descending) using the A..Z/Z..A button.
Create UNIONs
To combine the result from multiple SELECT statements into a single result set, use
the Add union link of the Query Explorer popup menu.
Note: The column names from the first SELECT statement are used as the
column names for the results returned.
Selected columns listed in corresponding positions of each SELECT
statement should have the same data type.
You can edit this text according to the rules of SQL, and all the changes will be
displayed on the Diagram page of Visual Query Builder.
Data are displayed as a grid (or as info cards) which provide a lot of useful features
such as editing, grouping, sorting, filtering, etc. See Data View 326 for details.
Navigation bars of these tabs as well as popup menus of their working areas places at
your disposal the following functions for managing data:
· Export Data 342 allows you to export data to various formats, including MS Excel, MS
Access, RTF, HTML, PDF and more.
· Get SQL Dump 349 exports data to the SQL script as a number of INSERT statements.
· Import Data 352 provides you with possibility to import data from MS Excel, MS
Access, DBF, XML, TXT, and CSV.
· Edit BLOB 337 allows you to view and edit the content of BLOB and TEXT fields.
Navigation buttons
Both data representations are equipped with navigation buttons. They are represented
at the top of the data tab and allow you to navigate between records and to accomplish
common operations:
· To add a new record, use the Plus button or the Insert shortcut.
· To delete a new record, use the Minus button or the Delete shortcut.
· To edit an existing record, push the corresponding button or invoke the Data Input
Form 333 using popup menu of the necessary record, with Ctrl+Alt+D shortcut, or
with the corresponding link at the Navigation bar. To edit a field value, click it and
enter the new one inline.
The pagination option allows you to limit the number of browsed records. By default, the
number of records represented in grid at once is 1000. To change the number of records
represented in the current grid, enter the necessary value in the pagination bar. To
specify the default one or to disable pagination, use the data grid option 438 .
Navigation bar
The Data management group of the Navigation bar allows to invoke Data Input Form 333 ,
SQL Editor 311 with SELECT query, Data Export 342 , and Data Import 352 modules using
corresponding links, also get SQL dump 349 of the current data set and print current data
with enabled preview in WYSIWYG mode.
See also: Table Editor 78 , SQL Editor 311 , Visual Query Builder 316
· the full grid mode is a fully functional data representation equipped with abilities to
filter and to sort data;
· the simple grid mode is provided for working with large number of records. For speed-
up data fetching, filtering and sorting abilities are not enabled in this mode. The
notification bar at the top of the grid (see the picture below) announces that the grid
has been switched to the simple mode.
By default, the grid automatically switches to the simple mode for queries returning more
than 5000 records (the number can be customized in the Options 438 dialog).
The following abilities are not available in the simple grid mode:
Click the column caption to sort data by the values of this column. To select sort
order (ascending or descending), use popup menu of the column caption.
To sort data on a combination of grid columns, use the Advanced sort... link of the
popup menu of the grid's header. The Advanced sorting window will be shown.
Select there the columns you want to sort from the Available columns list in the
order of priority. Specify the sort order if necessary and click OK.
To cancel the sorting order, press Ctrl and click on the sorted column caption.
There are several ways to filter data represented in grid. See the corresponding
topic 334 to find out their descriptions.
You can show/hide columns using a button in the left top corner of the grid. Just
check/uncheck the column in the drop-down list.
Columns reordering
Grouping records
You can group grid data by any of the columns by dragging the column header to the
destination area. Now all the records are displayed as subnodes to the grouping row
value as shown in the picture. To reverse grouping, just drag the column name from the
upper area back.
To get a sum of column values, a min or a max value, an average column value or an
amount of records, use Data Grid Footer. Select the Footer item at the grid
caption's popup menu.
It will be shown at the bottom of the grid. The popup menu of the footer allows you
to get an aggregate function result calculated with the corresponding column
values.
Data alignment
The grid's header popup menu allows to align column data. Use the Alignment link
and select the alignment type.
Fixing columns
You can fix grid columns to view them permanently when working with other grid
data. To fix a column, choose the corresponding item from the grid's header popup
menu.
Row numbering
There is also a possibility to display row numbers in grids. You can adjust 440 the
corresponding column to yours liking.
Inline images
To enable/disable this view mode, open the Enable inline images window using the
Manage inline images item of the column popup menu. The window options allow to
set or change the image fitting and specify the row height. To add new images or
change existing ones, use BLOB Editor 337 (see below).
To edit a BLOB field 337 , double click the field, or use the corresponding popup menu
item. There are also possibilities to export all BLOBs stored in the table column to
files and import BLOBs from a directory to the table columns. In this case you need
to set the Target directory, specify the template to be used for file names and the
column BLOBs to be exported from (imported to).
and edit data directly in info cards or with Data Input Form 333 .
The dialog's fields contain the values of the current grid row. Use the Insert button to
enter values of a new record and the Post button to update the current row. The
Cancel button reverts all the field values within a form to their initial values (or to the
last posted values). The Previous and Next buttons allow you to switch between grid
records without closing the dialog.
Controls containing values of primary and foreign key columns are marked with the 'gold
key' and 'silver key' images accordingly. Controls containing values of required (NOT
NULL) columns are marked with a red asterisk.
There are possibilities to use lookup editors on working with columns linked with foreign
keys, a calendar for timestamp columns and a calculator for decimal ones.
Select the Use as Filter item from the field popup menu to filter records by the
current column value.
Use the drop-down button in the column caption area to filter records by the
selected column value(s) or enter the filter condition directly in the filter row 443 .
Invoke simple filter dialog using the Custom item of the column caption area drop-
down list. Select a logical operator for checking the column values (like "is less
than", "is greater than", etc.) and set the value to be checked by this operator in
the next box; then set the second condition if necessary in the following way and
set the relation between these two conditions, whether both of them should be
matched or just one of them; use the '_' character to represent any single symbol in
the condition and the '%' character to represent any series of symbols in the
condition.
To filter data according to more difficult custom conditions, use the Filter Builder
dialog. To invoke the dialog, use the Set Filter link of popup menu or click the
Customize button on the Filter panel. This panel is visible if any filtering is already
applied to the grid (you can use column header menu or grid menu for quick
filtering).
The dialog also allows to save filter criteria to an external file for future use.
After you set a filter, the filtering panel becomes visible at the top/bottom of the grid
where you can see the active filtering condition and easily enable or disable it by clicking
the check box on the left. To customize the filtering process, use filter options 443 .
The Copy current filter as SQL condition to clipboard feature is useful in case the same
compound filter is applied several times. Just once apply the filter, copy to clipboard as
SQL condition, paste to SQL Editor 311 and save as a query. You can also use Generate
query link on the Navigation bar.
See also: Data View 326 , Table Editor 78 , SQL Editor 311 , Visual Query Builder 316
the Edit BLOB link of the field's popup menu. The editor also can be called from BLOB
Viewer 377 with the Edit current BLOB button.
With BLOB Editor you can work with all BLOB columns of the grid. To switch between
columns, select the necessary one from the BLOB field list.
BLOB Editor allows you to navigate between the grid records using the Previous and Next
buttons. You can load the new BLOB content and save or clear it using corresponding
buttons. After changes are made, click the Post button to apply the changes or the
Cancel button to discard them.
and select the Export Data item from the Navigation Bar.
The file name may contain current timestamp with the %ts:TIMESTAMP_FORMAT%
string. Examples of valid log file names:
dbname_export_%ts:yyyy_mm_dd%.log
export_%ts:yyyy_mm_dd_hh_mm%.log
%ts:yyyy_mm_dd_hh_mm_ss%.log
OpenDocument Spreadsheet, OpenDocument Text, DBF, PDF, RTF, DIF, SYLK, and
LaTeX.
Microsoft Excel
The Data Format tab contains general options, which allow you to adjust the format for
each kind of Excel cells. This means that you can specify such parameters as font,
borders, filling color and method, etc. for each entity (such as data field, header, footer,
caption, data, hyperlink and so on) separately. Also it is possible to create styles to
make target Excel file be striped by columns or rows (the Styles tab).
The Extensions tab provides a possibility to add hyperlinks and notes to any cell of
target file. Click the Plus button to add a new hyperlink or note to target Excel sheet
and adjust its parameters. Click the Minus button to delete added hyperlink or note.
The Advanced tab allows you to define page header, page footer and title for target
Excel sheet.
HTML
The Preview tab allows you to select the style of HTML file from a number of built-in
templates provided by the Templates combo box. You can choose any of these
templates, customize it by clicking on objects in the preview panel, and save it as a
custom template using the Save template button. Use the Load template button to load
previously saved custom templates from hard disk.
The Basic tab allows you to specify basic parameters of target HTML file, such as its
title, cascade style sheet options, etc.
The Multi-file tab provides you with a possibility to split target HTML file into several
separated files. This tab allows you to specify the record count for a single file, set an
option to generate an index HTML file, and add an ability of navigation between each
other to each of exported files.
The Advanced tab contains such HTML options as default font, background, cell padding
and spacing, etc.
Text files
Set the Calculate column width options on if you want each column of target file to be
adjusted to the maximum number of characters in it. The Spacing option specifies the
number of spaces between columns in the target file.
CSV files
You can specify column separator and optional values quote character for the target file
on this step.
XML documents
Specify XML document encoding in the Encoding edit box and set the Standalone option
on if you wish the target document to be standalone.
· Select the number of records to be exported from each table: a fixed number or all
records.
· Specify actions to be executed after the export. To open the result files in the
associated program (MS Excel, Notepad, default browser, etc), check the Open file
box. To send the result files to the default printer, use the Print file checkbox.
· open the table in Table Editor or open and execute query in SQL Editor or Query
Builder;
· open the Data tab or the Result tab respectively;
· use the Get SQL Dump item of the Navigation Bar.
See also: Export Data Wizard 342 , SQL Script Editor 362
You can also select the fields to be included in the result INSERT statement. All the
table fields are included into the Selected fields list by default. If you do not want some
fields to be exported, move them back to the Available fields list. Text, GUID, Date,
Time, and DateTime columns are included in the result INSERT statements according to
the Storage Options of the Database Profile 28 .
To add the "CREATE TABLE" to the top of the dump, check the corresponding box.
Get SQL Dump Wizard allows you to send the result script to SQL Script Editor 362 or to
save it to a specified file. Select the Send to script editor option to load the result to
the editor. To save the result to the file, enter the script file name (*.sql).
To import data,
· Set the format 353 of the input data and the source file name;
· Map source file columns and target table fields 355 ;
· Specify other import options 358 .
3. For ODBC data sources specify the connection string to be used to connect to the
data source.
4. Select the data source to import: a table of MS Access database or a spreadsheet of
MS Excel.
5. Enter the password to the database (MS Access).
6. For CSV file set the delimiter and quote characters.
7. Select source file Encoding.
8. For .XML files, define the XPath to the data to be imported to the selected table and
select whether data is stored in Attributes or in Subnodes.
Example 2:
To import data from the following .xml file, use XPath=/Employees/Employee and Data
location=Subnodes
Example 3:
To import data from the .xml file below, use XPath=DATAPACKET/Data/Item and Data
location=Attributes
<?xml version="1.0"?>
<DATAPACKET Version="2.0">
<Data>
<Item ID="1" FirstName="Klaus" LastName="Salchner" PhoneNumber="410-727-
5112" />
<Item ID="2" FirstName="Peter" LastName="Pan" PhoneNumber="604-111-1111" />
</Data>
</DATAPACKET>
· You can map columns automatically by order with the Auto Fill and Auto fill all
maps buttons.
· You can do it manually using the drop-down list of Source column fields.
· To map columns visually, open Map builder 356 with the Build map link.
It's useful to save a specified map to a file for further using it in the next wizard
sessions. To save a map, use the More... button and follow the Save map link.
To see the 100 first rows of input file or output table, use the More... button and follow
the View source data or Preview results links respectively.
You can also specify Replacements to be applied to the selected column before the
import and data format masks 357 used for the input file.
To exclude the first file row, use the File contains column header checkbox.
To specify the accordance between source and target columns visually, use popup menu
of the upper row to map source file columns to target table fields.
For text files define columns bounds first. To add a bound, double-click near the column
data in the builder area. To map a column to a target table field, select the field in the
Target field list and then click between the bounds.
Use the window fields to indicate format masks of the source data imported to the table.
It allows the application to import data correctly.
The components of the date time format mask are represented at the window. Compose
your date, time, and date time format mask of this components and separators. The
following table contains some types of input fields and suggests masks to import them.
You can also set decimal and thousand separators, and custom NULL,TRUE and FALSE
values. If you have several values to be imported to NULL(TRUE, FALSE) value, use
semicolons to separate them.
Logging
This options group let you to manage logging of the import process.
Scripts
There are many cases where the import process is necessary to correct with additional
scripts. So to disable table indexes before the importing, specify the corresponding
scripts to be executed before and after the process.
The typical example of usage of the Before each table and After each table scripts is
the import data to autoincrement columns of several tables. In this case it's neseccary
to set the corresponding scripts:
SET IDENTITY_INSERT %table_name% ON
and
SET IDENTITY_INSERT %table_name% OFF
to be executed before and after import data to each table correspondingly.
Import mode
If the Update existing records option is turned ON, the records will be either updated or
inserted: an UPDATE will be performed when a target row exists in the table and an
INSERT is performed when the target row does not exist.
9 Database Tools
MS SQL Maestro provides a number of powerful tools for working with databases.
· Simple tools for DML procedures 407 and Updatable views 409 generation allow to
create a bunch of CRUD procedures automatically.
Script Runner allows to execute .sql files as well as archived scripts directly from .zip
files. In case archived files this tool unpacks zip archives to temporary files by itself for
further executing.The tool neither starts any implicit transactions before executing the
script nor issues COMMIT or ROLLBACK commands after the executing.
To execute a script with Script Runner, set the file name and the Stop execution on
error option value. This option allows to view all the execution errors (OFF). The
specified script will be executed immediately on the database which name is represented
at the top of the window.
To work with a script within SQL Script Editor, load it from an .sql file or type it in the
editor area directly. To prevent mistakes in SQL syntax, the editor supports syntax
highlighting, code completion and divides the script text into logical parts that can be
individually collapsed or expanded (code folding). All the logical parts are represented at
the Explorer at the Navigation bar. It allows you to transfer to the proper script
fragment quickly by clicking the corresponding node in the tree.
SQL Script Editor allows you to execute the whole SQL script or only its selected part.
To make the executing of a large script much faster, execute the script directly from a
file with Script Runner 361 . By default, if a user opens a file larger than 100K, SQL Script
Editor will suggest him to execute the script file without opening it in the editor. This file
size may be changed at the editor's options 430 tab.
Backup Database tool allows you create full database backups, differential database
backups, and transaction log backups. Use buttons on the top of the window to select
the type of backup you want to perform on the specified database. The tool supports
only Simple Recovery model. To run this wizard select the Tools | Backup Database
main menu item.
To find some explanation for the tools's parts and their elements, see the Backup
options 365 topic.
Database Databases, files, Under the Simple Recovery Model, file and
Differential and filegroups filegroup backups are available only for read-only
filegroups.
Transaction Log Transaction logs Transaction log backups are not available for the
Simple Recovery Model.
Files and File Groups part represents selected filegroups or files you want to back up. To
manage them, use the appropriated section on the Navigation bar or popup menu of the
File and File Group box. For more information about file and file group's properties see
Files 206 and File Groups 209 .
Select Backup Devices to which to write the data. Microsoft SQL Server 2005 can back
up databases, transaction logs, and files to disk and tape devices. To manage them, use
the appropriated section on the Navigation bar or popup menu of the Backup Devices
box. For more information about their properties see Backup Devices 261 .
Common options part allows you to specify Backup name and Backup description. You can
also choose one of the following Expiration options.
After Specify the number of days that must elapse before this backup set expires and
can be overwritten. This value can be from 0 to 99999 days; a value of 0 days
means that the backup set will never expire.
On Specify a specific date when the backup set expires and can be overwritten.
Stop on error
Instructs BACKUP whether to continue despite encountering errors such as invalid
checksums.
Copy only specifies that the backup not affect the normal sequence of backups. A
copy-only does not affect the overall backup and restore procedures for the database.
You can create a copy-only backup for any type of backup. The effect of this option
varies with the general backup type, as follows:
· A data backup taken with the option cannot be used as a base backup for
differential backups. Differential backups taken later will behave as if the copy-only
backup does not exist.
· A log backup taken using the option does not truncate the transaction log.
Note: Using backup checksums may affect workload and backup throughput.
Use Media options to define backup write method. Possible values are: Append to existing
media (appends to the existing file), Overwrite existing media (overwrites the file).
Media name
Define the media name for the entire backup media set. If name is specified, it must
match the previously specified media name already existing on the backup volumes. If it
is not specified, there is no verification check of the media name.
Media description
You can specify the description of the media set in this field.
Media password
Enter the password for the media set to overwrite the backup only by reformatting.
Note, if the backup media is password protected, SQL Server does not write to the
media unless the media password is supplied. This check is not overridden by the SKIP
option. Password-protected media may be overwritten only by reformatting it.
Use Transaction log options (Available only if Transaction Log Backup selected) part to
specify that the log not be truncated and cause the database engine to attempt the
backup regardless of the state of the database (Backup the tail of the log, and leave
the database in the restoring state). This option allows backing up the log in situations
where the database is damaged.
With the Truncate the transaction log option, the database must be online.
Use the Execute link on the Navigation bar to start the backup process.
First you need to connect to the server where the backup is to be restored, run the
wizard and specify the database for which the backup has to be restored. To restore
the backup to a new database, select the Create new database option and specify the
connection settings to the database to be created.
After that select the backup to be used for the restoring. By default, the Backup
Devices part displays the default backup device. To add other devices, use the
corresponding button. The Backups part represents a list of all backups stored on the
selected backup devices. Select the backup to restore from the list by checking the box
near the backup name.
Now select the final restore state, define the location in which the data files and log
files are created, and choose the action to perform after the script generation.
Use the More... button to save the extract configuration for future use or to load the
previously saved configuration for faster extract.
· Selecting database to extract and the target script file name 370
Note: this step is not available if you select the extract data only mode when
selecting components to be extracted 370 .
Note: this step is not available if you select the extract structure only mode
when selecting components to be extracted 370 .
Select the data dump mode to be used (Multi-row INSERT statements or separate
single-row INSERT statements) and specify commits' frequency.
You can also set extract data after its table definition.
Fill the Open generated script in the script editor box to load the result script to SQL
Script Editor 362 .
If checked, opens the result files in the associated program after making the report.
BLOB Viewer also allows you to save all BLOBs from a table or view to a given directory.
Just click Save to files on the Navigation bar and fill all fields in the Export BLOBs window
shown below. You can use table columns' names enclosed in % as a file name template.
Diagram Viewer provides a special control for customizing the diagram properties. This
control is located in the Properties group of the Navigation Bar and consists of four
separate subgroups:
Appearance
Contains properties responsible for major diagram appearance:
· Chart type - defines a way of how the diagram will be represented: as bars, lines,
areas, points, pies, or fast lines
· Color each points - if checked, each bar, point, line or sector of the diagram has an
individual color; if not checked, all the points are colored red
· Show axis - defines if the diagram has the axis and background grid or not
Data
Contains the Labels source property which allows you to specify the field for X-axis
labels as well as for diagram point marks .
Titles
Contains properties for defining titles for different parts of the diagram:
Legend
The only Visible property of this subgroup specifies whether the legend rectangle should
be represented on the right side of the diagram or not.
Select the desired graphical format in the Destination format radio group and specify the
file name in the Destination file name box.
Set the destination width and height by the corresponding spin edits. Check or uncheck
the Keep aspect ratio option to keep the image ratio for exported image or not. Check
the Open exported image in associated program option to view the image after the
export is done.
The Data Analysis tool allows you to save the created OLAP cube to .cub file, print it, or
export it to Excel, HTML, XML, and text file.
Note: Use for the Data Fields area only numerical columns.
To set the aggregates calculated on the numeric columns, use the Customize cub
window opened with the corresponding link at the Navigation bar. The window provides
you also with an ability to specify columns the summary to be sorted by, the sort order
and the max number of records represented in grid.
· specify data sources 394 for the data to be used in the report;
· add all necessary objects 394 to the report template;
· set the objects' format within the Inspector window 396 .
The prepared report pages are available immediately at the Preview window where you
can browse it, save to it an .smr file, or print.
Datasources
To use content of a table (view) column data in a report,
· check the necessary database is selected as Database at the Navigation Bar;
· drag the table which data to be used in the report to the Datasources pane at
the Navigation Bar;
· drag the necessary column from this pane and drop it to the necessary location
on a report page.
Designer tools:
Select tool
The standard tool to select objects, modify their sizes, etc.
Hand tool
The tool allows dragging a report page.
Zoom tool
When the button is pressed, clicking on the left button doubles the zoom (adds 100%),
while clicking the right one zooms out by 100%. When holding the left mouse button
while dragging,the selected area would be zoomed.
Available objects:
Band objects allow to specify where, when, and how to display data and information in
reports. Bands are used for logically placing the objects it contains at a location on the
output page. Insert Band adds an area with definite behaviour according to it’s type
such basic bands as Header, Footer, Title, and Summary, and databands whose allow to
print data from database tables such as Master Data, Detail Data, etc.
Text object displays one or several text lines within the rectangular area.
Picture object displays a graphic file in BMP, JPEG, ICO, WMF, or EMF format.
Subreport object allows inserting an additional report design page inside the basic one.
System text displays service information (date, time, page number, etc), as well as
aggregate values.
Draw object represents different geometrical figures (diagonal line, rectangle, rounded
rectangle, ellipse, triangle, and diamond).
Page options
This dialogue allows you to set the page settings of the prepared. To invoke the
window, use the Edit... link of the page blank space popup menu. The dialogue has two
pages: Paper and Other options. On the Paper page, you can select size and alignment
of paper, as well as set margins. In Paper source drop-down lists you can select a
printer tray for the first page and the rest of the report pages.
On Other Options you can set the number of columns for multi-column reports’ printing.
The current settings are displayed in the designer.
The Print to previous page flag allows you to print pages, beginning from blank space of
the previous page. This option can be used in case when a report template consists of
several pages or when printing batch (composite) reports.
The Mirror margins option switches right and left margins of page for even pages during
previewing or printing a report.
The Endless page width & height option increases page's sizes depending on number of
data records on the page (when running a report). In this case you will see one big page
in the preview window instead of several standard size pages.
The Large height in design mode option increases page’s height several times more. This
feature can be useful if many bands are located in the page, and must be used when
working with the overlay band. This only effects the page height in design mode.
Align - set here the align option of the object according to the list.
AllowExpressions - enables the ability to display not only a static text, but expressions
as well.
AllowHTMLTags - Enables using some simple HTML tags inside the text of an object. This
option is disabled by default.Here is the list of supported tags:
<b> - bold text;
<i> - text in italic;
<u> - underlined text;
<sub> - subscript;
<sup> - superscript;
<font color> - font color;
<nowrap> - text which does not get broken up when using WordWrap, but gets
transported wholly.
Font: there are abilities to specify the charset, font color, font name, and font size, and
also set the bold, italic, underline, strike out attributes.
Frame: You can set as the color, the style and the shadow for all the frame, as well as
for each frame line.
GapX, GapY – text indents from object’s left and top boundaries (in pixels).
A diagram of your database can help you define operational aspects of your application
logic that you might otherwise overlook. Also, a well-defined data diagram that
accurately represents your tasks can be helpful in orienting employees to goals and
operations. The data diagram can also serve as an invaluable communications tool for
both internal and external constituents.
See also: Designer Navigation bar 401 , Schema Designer Toolbox 401 .
Adding a table
You can add an existing Microsoft SQL table to the diagram using popup menu in the
working area, or with the corresponding link on the Navigation bar 401 .
To create a new table, use the appropriate item of the popup menu in the working area.
The table will be created in the current database.
Tables also may be dragged on the diagram from Explorer and the similar to Explorer
tools like Object Manager and Object Browser.
Moreover, Designer provides you with a possibility to represent all the tables and
relationships existing in the database automatically (the Reverse engineering link of the
Navigation bar). At that the database contents will be represented on a diagram in the
most compact and vivid manner.
All the diagram objects are available for editing. Just double click the object (table or
relationship) to view/edit its properties within the corresponding editor.
· Choose the Create relation tool on the Toolbox 401 . Your mouse cursor will change
its appearance.
· Then click on the table (child table) that will have foreign key and then click on
the second table (parent table) whose primary key will be referred by the new
foreign key.
· Specify properties of the relationship been created in the Foreign Key Properties
89 window.
With the Create new… item of the popup menu you can also add a new field, an index, a
trigger, etc. to the selected table. For more information about object properties see: Field
Editor 82 , Index Editor 86 , Create Trigger Wizard 97 .
It’s also possible to physically delete a table/foreign key from the database: just select
the object to delete and use the appropriate item of the popup menu.
Designer also allows you to edit shape of the line representing foreign key relations/
logical relations. In order to break the line you should
· Select the relationship.
· Press Ctrl and click on the necessary line section to create a new node.
· Position the node by dragging.
Use the Database drop-down list to move around your Microsoft SQL databases.
There are also links for adding a New diagram or an existing table to diagram quickly.
Reverse engineering
The link provides you to create a new diagram with all the database tables and
Remove selection
The link cancels current object selection.
Certainly, it's possible to customize Schema Designer with Configure designer. For more
information see Schema Designer Customization 435 .
The Navigator part allows you to adjust the scale of the diagram and the position of the
visible part.
Besides the Navigation bar allows you to Load a diagram from file, Save to file, and Save
as image (Bitmap, GIF and JPEG formats are supported).
Move
The tool is intended for selection of diagram objects. Use the tool then click anywhere
inside of the object. Double click opens the corresponding Object Editor.
To select multiple objects, use the tool then click and drag a selection rubber-band so
that the rubber-band box encompasses the objects you want to select, and then
release the mouse button.
To add objects to the list of already selected objects again, use the Move tool then
click anywhere inside of the object holding the Shift button. To quick launch of the tool,
use M shortcut.
Use Create text box to add title and comments on your diagram. Click on the
necessary place and double-click on the appeared box to enter a text. You can also
tune up the text font, color and size with Text options of the box popup menu. To quick
launch of the tool, use XX shortcut.
Moreover you can add notes and also links between them and diagram elements using
Create note and Create link to note links. To quick launch of the tools, use N and L
shortcuts accordingly.
Lock
The tool to locking/unlocking diagram objects. This feature prevents your diagram from
unforeseen changes: when the diagram is locked, you can neither move/resize/delete
existing objects nor add new ones.
Hand tool moves a diagram within its window. To quick launch of the tool, use H
shortcut.
Zoom magnifies and reduces the view of a diagram. To zoom out, hold the Alt
key. To quick launch of the tool, use Z shortcut.
There are also tools allowing to Create table and Create relation directly from
the Designer. To quick launch of the tool, use T and R shortcut.
Below you can find toolset for aligning the selected objects by left and right edges, by
horizontal and vertical centers, tops and bottoms.
Click the Zoom in button in the options bar to magnify to the next preset percentage.
When the image has reached its maximum magnification level, the command is dimmed.
Click the Zoom out button in the options bar to reduce to the previous preset
percentage. When the image has reached its maximum reduction level, the command is
dimmed.
Pay attention to the Fit diagram function, that pick-up properly scaling factor to display
your diagram fully. For your convenience the Fit selected, Fit height, and Fit width were
added.
To access the Process Browser window, select the corresponding item from the Tools
menu.
This tool allows you to see the way any database object is involved in the net of
scheme dependencies. The selected object is displayed in a highlighted rectangle in the
center of the working area. The right side of this area represents objects depending on
the selected one. The left side represents objects on which the selected object
depends.
To highlight all occurrences of an object in the diagram, click the appropriate rectangle.
Double click an object to change the tracker focus to this object. Right click a rectangle
to display a popup menu with common operations related to the appropriate object.
The recursive dependencies are marked with a semicircle. This means marked object
depends on itself directly or via other objects.
Example
Suppose we have two procedures A and B calling each other. The tracker displays these
dependencies in the following way:
The SQL Generator window can be invoked from the Explorer tree.
The reasons for using DML Procedures instead of allowing ad hoc SQL statements
are:
· The best possible performance
After the first use of each stored procedure, the plan for executing the procedure is
cached in the server's procedure cache. For subsequent invocations of the stored
procedure, the plan is reused. This avoids the parsing and optimization steps with their
overhead.
· Removing of the SQL code from the other layers of the application
By removing the SQL statements from the application code, all the SQL can be kept in
the database.
· select the Object | Generate updatable views... main menu item (to create views for
several tables) or use the corresponding popup menu item of the table's node at the
Explorer tree (to create a view for one table).
· Specify tables the views will be created for (in case of several tables).
· Specify the abilities to be available on working with the view data. By default the
views are generated for inserting, updating, and deleting of table data.
· Adjust the name templates of views and corresponding triggers.
· Select the action to perform after the generation. The created definitions can be
copied to Clipboard, saved to a file, sent to SQL Script Editor or executed immediately.
Let's see the wizard in action on the example of a table with the following SQL
definition:
The primary table must contain now only 'id' and' full_name' columns. The field 'city_id'
will be added to the table automatically.
Now we have to specify what kind of primary key to be created for the secondary table:
surrogate or natural. We create create the 'city' table with a surrogate primary key.
To get SQL scripts enforcing NOT NULL constraints to columns of an existing table,
select the necessary columns, specify the default values to be used instead of existing
columns NULLs and select the action to perform after the generation. The created
scripts can be copied to Clipboard, saved to a file, sent to SQL Script Editor 362 or
executed immediately.
9.19 Dialogs
MS SQL Maestro provides two dialogs for searching and replacing text in the editor areas
of the database tools. Both of them are available through the popup menu of the editor
area.
Text to find
Enter a search string or click the down arrow next to the input box to select from a list
of previously entered search strings.
Case sensitive
Differentiates uppercase from lowercase when performing a search.
Regular expressions
Recognizes regular expressions in the search string.
Forward
Searches from the current position to the end of the file. Forward is the default.
Backward
Searches from the current position to the beginning of the file.
Global
Searches the entire file, in the direction specified by the Direction setting. Global is the
default scope.
Selected text
Searches within the selected text only, in the direction specified by the Direction
setting. You can use the mouse or block commands to select a block of text.
From cursor
The search starts at the cursor's current position, and then proceeds either forward to
the end of the scope, or backward to the beginning of the scope depending on the
Direction setting. From Cursor is the default setting.
Entire scope
The search covers either the entire block of selected text or the entire file (no matter
where the cursor is), depending upon the Scope options.
Text to find
Enter a search string. To select from a list of previously entered search strings, click the
down arrow next to the input box.
Text to replace
Enter the replacement string. To select from a list of previously entered search strings,
click the down arrow next to the input box. To replace the text with nothing, leave this
input box blank.
Case sensitive
Differentiates uppercase from lowercase when performing a search.
Regular expressions
Recognizes specific regular expressions in the search string.
Prompt on replace
Prompts you before replacing each occurrence of the search string. When Prompt on
replace is off, the editor automatically replaces the search string.
Forward
Searches from the current cursor position, to the end of the file. Forward is the default
Direction setting.
Backward
Searches from the current cursor position, to the beginning of the file.
Global
Searches the entire file, in the direction specified by the Direction setting. Global is the
default scope.
From cursor
The search starts at the cursor's current position, and proceeds either forward to the
end of the scope, or backward to the beginning of the scope depending on the Direction
setting. From cursor is the default Origin setting.
Entire scope
The search covers either the entire block of selected text or the entire file (no matter
where the cursor is in the file), depending upon the Scope options.
Replace All
Click Replace all to replace every occurrence of the search string. If you check Prompt
on replace, the Confirm dialog box appears on each occurrence of the search string.
10 Server Maintenance
MS SQL Maestro provides graphical wizard interface for native Microsoft SQL server
maintenance operations. To make your work with the server easier, MS SQL Maestro
also provides some graphical tools for working with the server as a whole.
To run Detach Database Wizard, select the Database | Detach Database main menu
item.
Host name
You can select or type the server instance name.
You can use the current Windows user account for authentication, if this account is
added to the sever as login. For this you need to select the Windows Authentication
radio item.
You can also specify a server login for authentication, if you select SQL Server
Authentication. The Login name and Password text areas become enabled. You have to
type a valid login and password there.
Database Name
Defines the name of the database to be detached.
Update Statistics
Specifies whether to skip or run UPDATE STATISTIC. To skip Update statistics, you have
to leave this field unchecked. To explicitly run UPDATE STATISTICS, you need to check
this field. By default, Update statistics is performed to update the information about the
data in the tables and indexes in the Microsoft SQL Server 2005 Database Engine.
Performing update statistics is useful for databases that are to be moved to read-only
media.
Connections
Defines the number of connections to the database. You can end all active transactions
in this database selecting this field and clicking the red cross on the right.
For Replication
Shows whether a database is involved with replication.
To run Attach Database Wizard, select the Database | Attach Database main menu
item.
Host name
You can select or type server instance name.
You can use the current Windows user account for authentication if this account is
added to the sever as login. For this you need to select the Windows Authentication
radio item.
You can also specify any server login for authentication, if you select SQL Server
Authentication. The Login name and Password text areas become enabled. You have to
type a valid login and password there.
Check the Create a single profile option to set the database name manually and create a
single profile for this database. Use this option if the SHOW DATABASES Microsoft SQL
command is forbidden on your database server (e.g. for security reasons).
Attach As
This field defines the name of the new database. Database names must be unique within
an instance of SQL Server.
Owner
Specify the owner in the field. By default, only the owner of an object can perform
various operations with the object. In order to allow other users to operate it, privileges
must be granted. (However, users that have the superuser attribute can always access
any object.)
Rebuild Log
Specifies that the database is created by attaching an existing set of the operating
system files. This option is limited to read/write databases. If one or more transaction
log files are missing, the log file is rebuilt.
Enable broker Specifies that Service Broker is enabled for the specified
database.
New broker Creates a new service_broker_guid in sys.databases
and the restored database.
Error broker Ends all conversations with an error that indicates a
conversations copy of the broker has been created.
11 Options
MS SQL Maestro allows you to customize the way it works within the Options dialog. To
open the dialog, select the Tools | Options main menu item.
The window allows you to customize the options grouped by the following sections:
· Application 423
General MS SQL Maestro options: environment style, confirmations, window
restrictions, explorer tree, SQL Editor, Visual Query Builder, etc.
· Appearance 453
Customizing program interface - bars, trees, menus, etc.
Besides, the Options dialog allows you to export all program settings to a *.reg file for
future use, e.g. on another PC (see Export Settings 462 for details).
It is a good idea to check through these settings before you start working with MS SQL
Maestro. You may be surprised at all the things you can adjust and configure!
11.1 Application
The Application section allows you to customize common rules of MS SQL Maestro
behavior. The section consists of several tab; follow the links to find out more about
each of them.
· Preferences 423
· Confirmations 424
· Directories 426
· Tools 426
· Explorer 428
· Table 438
· Colors 441
· Formats 442
· Filter 443
11.1.1 Preferences
User interface area allow you to select your favorite UI style according to your
preferences.
11.1.2 Confirmations
Use this tab to manage application confirmations.
Transaction confirmation
Select whether you will be prompted to commit or rollback active transaction or MS SQL
Maestro will commit or rollback transactions without asking.
11.1.3 Directories
The tab allows you to specify default directories to be used on database profiles
creating. You can use such variables as %database_name%, %database_alias%, and %
user_name%.
Example:
To store all SQL scripts in folders sorted by databases in the "C:\SQL Scripts\" directory,
specify the default directory for SQL scripts as follows:
C:\SQL Scripts\%database_name%\
11.1.4 Tools
Below you will find a detailed decryption of the following tools options.
simultaneously.
simultaneously.
simultaneously.
11.1.4.1 Explorer
Below you will find a detailed decryption of the following explorer options.
You can also exclude/include rarely used objects from/to the Explorer tree. Manage
object groups to be displayed at Explorer with corresponding checkboxes.
11.1.4.2 Object Manager
Below you will find a detailed decryption of the following Object Manager options.
Below you will find a detailed decryption of the following SQL Editor options.
Auto commit
Check the option to execute queries in autocommit mode (default value) or leave it
blank to manage transactions manually.
Below you will find a detailed decryption of the following SQL Script Editor options.
Below you will find a detailed decryption of the following Query Builder options.
Visible tabs
These options specify which the query builder tabs are available and which are not.
Check them to make the appropriate tabs visible.
Script format
These options specify the case formatting of keywords and functions in query text on
the Edit tab. As is saves the original case, Uppercase sets all the keywords/functions to
upper case, Lowercase sets all the keywords/functions to lower case, and First upper
sets the first letters of all keywords/functions to upper case.
Style
These options specify how different the Query Builder objects look like - 3D, flat, etc.
Colors
These options define colors of the different Query Builder elements: condition row,
active caption, table client area, etc. Click an item to select a color for the appropriate
Query Builder element.
11.1.4.5.1 Colors
The tab is provided to editing of the Query Builder color schema. Customize colors for all
editor element according to your preferences.
Below you will find a detailed decryption of the following BLOB Viewer 377 options.
Initial tab
Specifies which tab of BLOB Viewer should be active when it is initially opened.
11.1.4.7 Data Export
This window allows you to customize formats applied to exported data. Edit the format
masks to adjust the result format in the way you need.
In numeric formats using digit placeholder (# or 0) you can specify the format of
number. For example, integer 1234567890 with # ### ##0 integer format is represented
like 1 234 567 890. The locations of the leftmost '0' before the decimal point in the
format string and the rightmost '0' after the decimal point in the format string determine
the range of digits that are always present in the output string.
Conversion and their description for date, time and date time format:
DD day of the month, represented only by 2 symbols. For example, the first
day of month is 01
mm minutes
MM month
".", ",", ":" symbols can be placed as separators in format masks for integer, float, date,
time, date time, currency types.
Using Set defaults button, you can set default values of data formats.
The following topic provides a shot Database Designer 399 retrofitting's description.
The Set table height option determines what the table attributes will be represented at
the diagram (Caption only, Key fields, All fields or All fields and indexes).
If you enable snap to grid function by using the Snap to grid checkbox, when you move
the table or other object, its upper left corner "snaps" to the nearest grid point. This
feature will assist you to line up objects both horizontally and vertically. Diagram
objects moved on a diagram can be automatically snapped to the grid points even if the
grid is not displayed on the diagram.
The Colors options are to attune the Designer appearance to your taste. Here you
change diagrams and tables background colors, the colors of page delimiter and
Navigator view box.
Include permissions
If checked, the SQL definition includes all the GRANT statements, which are applied to
the object. Let's assume that a user named 'john' has rights to read the data from the
table 'customers' from the schema 'public', and a user named 'michael' can delete data
from that table. In this case the script includes itself the following forms:
Note: Please take a look at the topic Grant (Transact-SQL Reference) to learn more
about security management in Microsoft SQL server.
Include ownership
If checked, the SQL definition includes the object owner specification. For example, if a
user named 'john' is the owner of the table 'customers' from the schema 'public', the
script contains the following statement:
ALTER AUTHORIZATION
ON OBJECT :: [public].cutomers
TO [john]
GO
Place it in comments
With this option drop statement will be placed in comments of the SQL definition.
Row numbers
This options group allows you to manage the row numbering of the subobjects lists such
as fileds, indexes, parameters and so on.
To enable/disable the numbering, use Display row numbers checkbox. You can set the
number columns width with Maximum digit count. (I.e. for the value '3' the max column
number will be 999).
For uniformity you can use the Display leading zeros option. With this option enabled and
maximum digit count '3' you numbering column will be of the form: '001, 002, 003, ...'.
11.1.5.1 Table
Initial tab
Specifies which tab of Table Editor 78 should be active when it is initially opened.
MS SQL Maestro provides you with two grid modes 327 of viewing data:
- Fool grid mode allows you to group, filter and sort data in a usual way.
- Simple mode is provided for working with large records number. For data fetching
speed-up, filtering, sorting, and grouping features are not enabled in this mode.
Set the number of records to switch to simple mode automatically or select Always use
full mode.
Limit options
Allows you either to select all records from table after opening the Data tab, or select
only specified number of rows on one page with an ability to rotate pages and view all
data.
Row numbers
This options group allows you to manage grid rows numbering.
To enable/disable the numbering, use Display row numbers checkbox. You can set the
number columns width with Maximum digit count. (I.e. for the value '3' the max column
number will be 999).
For uniformity you can use the Display leading zeros option. With this option enabled and
maximum digit count '3' you numbering column will be of the form: '001, 002, 003, ...'.
Below you will find a detailed decryption of the data grid options.
Show footer
Shows the footer on the bottom of the grid view.
Layout preference
Select whether MS SQL Maestro should remember the column positions for the grids or fit
them automatically.
11.1.6.2 Colors
Below you will find a detailed decryption of the following colors options.
Striped grid
Displays the odd grid rows in a different color defined by the Stripes color option.
Grid color
Defines the background color of the data grid.
Row color
Defines the color of the selected row in the data grid.
Stripes color
Defines the color of the odd rows if the Striped Grid option is on.
Null values
Use Null value text to define the text that stand for the NULL value and use Font color
to set the color for displaying this text.
11.1.6.3 Formats
Below you will find a detailed decryption of the following formats options.
This window allows you to customize formats applied to data in grid. Edit the format
masks to adjust the result format in the way you need.
In numeric formats using digit placeholder (# or 0) you can specify the format of
number. For example, integer 1234567890 with # ### ##0 integer format is represented
like 1 234 567 890. The locations of the leftmost '0' before the decimal point in the
format string and the rightmost '0' after the decimal point in the format string determine
the range of digits that are always present in the output string.
Conversion and their description for date, time and date time format:
DD day of the month, represented only by 2 symbols. For example, the first
day of month is 01
mm minutes
MM month
".", ",", ":" symbols can be placed as separators in format masks for integer, float, date,
time, date time, currency types.
11.1.6.4 Filter
When checked the filter row is always represented in the data grid as an additional row.
Apply filter row changes and Apply column popup filter changes allows you to manage
the speed of the data filtering. To speed-up the process select Immediately as the time
the filter you are set will be applied.
Change the Position of filter panel and customize timestamp data filtering: check the Use
relative dates in filters box to include in column popup filter such options as "Yesterday",
"Today", "Tomorrow", "Last 30 day", "Last week", "Next week", and others; check the
Ignore time part box to neglect time part of timestamp data under the filtering.
By default filter buttons are shown at all columns header, to show filter button only in
selected column, check the corresponding option.
You can specify the case sensitivity of the grid filter with the Case insensitive checkbox
(ON by default).
· General 445
· Display 446
See also: SQL Editor 311 , SQL Script Editor 362 , Visual Query Builder 316 , Table Editor 78 .
11.2.1 General
If the Auto indent option is checked, each new indention is the same as the previous
when editing SQL text.
Insert mode
If this option is checked, insert symbols mode is default on.
Tab Stops
Defines the tab length, used when editing text.
Undo Limit
Defines the maximum number of changes possible to be undone.
11.2.2 Display
You can disable/enable the right text margin and the gutter of the editor area, set the
position of the right text margin as Right margin, and the Gutter width.
Use the Editor font and Font size to define the font used in all program editors and
viewers. The panel below displays the sample of the selected font.
You can enable/disable code folding in SQL editors and viewers and customize the colors
of its items.
11.3 Appearance
The Appearance section allows you to customize the application interface style to your
preferences.
Use the Scheme name box to select the interface scheme you prefer: Office XP style,
Windows XP native style, etc. You can create your own interface schemes by
customizing any visual options (Bars and menus, Trees and lists, Edit controls, Check
boxes, Buttons, etc.) and clicking the Save As button. All the customized options are
displayed on the sample panel.
· Buttons 457
· Splitters 460
The item allows you to select Bar style and menu animation from the corresponding
drop-down lists and to enable or disable such options as sunken border, F10 key for
opening menu, viewing full menus after delay, flat close buttons, gray-scale images.
11.3.5 Buttons
Use the Buttons item to customize MS SQL Maestro buttons. The tab allows you to
adjust the appearance of buttons and define sample buttons as well.
11.3.8 Splitters
Use the Splitters item to customize all MS SQL Maestro splitters according to your
preferences. Use the tab to select hot zone style (Windows XP task bar, Media Player 8,
Media Player 9, Simple or none) and specify the Hot zone drags a splitter option.
-U-
User Editor 200
Editing user properties 200
User interfase 15
Users 199
Create User Wizard 199
User Editor 200
-V-
View Editor 112
Editing view properties 113
Viewing data 115
Views 106
Create View Wizard 107
View Editor 112
Visual Query Builder 316
Executing a query 323
Working with editor area 322
-W-
WHERE condition 107
Window List 19
Wizards and Editors 47
Create object wizard - basic principles 44
Object Editor 47
-X-
XML Schema Collection Editor 169
XML Schema Collections 167
Create XML Schema Collection Wizard 168
XML Schema Collection Editor 169