Solutions Products Download Purchase Support News Members Company
SITE FEED
Support Forum
The fastest and most effective to get answers to your questions quickly.
FAQs
Quick answers to common questions.
Troubleshooting
Known issues and basic troubleshooting techniques for problems or unexpected behaviors.
Knowledgebase
Technical tips, How-to articles, and other tutorials about ApexSQL Tools.
Online Documentation
All of our help files for download or convenient viewing online.
Videos
Watch product demos, training videos, or tutorials of our products' main features. 

ApexSQL Knowledgebase

Tips and How-to Articles for ApexSQL Tools


How do I restore the original layout of my application's interface?

Introduction
The layout of the interface of your ApexSQL tool can be customized to your liking. For example, you can move toolbars around or hide them. You can also change the dimensions of your dialogs. When you make changes like these, how do you restore your layout to the original settings? That is, how do you make your application look as it did when you initially installed it?

The file called layouts.xml stores your application's layout. This file can be found on your application's installation folder (e.g. C:\Program Files\ApexSQL\ApexSQLDiff2008\layouts.xml). The following are stored in this file:

- Whether your application window is minimized or maximized when you start your application
- Dimensions of your application window and dialogs
- What toolbars and menus are displayed
- and more.

When you exit the application, Layouts.xml is saved.



How do I restore the original layout of my application's interface?
So to restore the original layout, do the following steps:

1) Close the application.
2) Go the application's installation folder.
3) Delete layouts.xml.
4) Start the application.

The layouts.xml file will be re-created and your interface will be restored to its original settings.

See Also
Losing your customized layout after an upgrade

Last Modified By
Janice Lee
2/10/2010

Labels:

...


Download links to old versions

DESCRIPTION
Here are the download links to the 2005 versions of our ApexSQL tools if you want to (or have been advised to by ApexSQL support) downgrade to the 2005 version:

LINKS
ApexSQL Audit Viewer 2005.01
ApexSQL Audit 2005.07
ApexSQL Edit 2005.26
ApexSQL Diff 2005.14
ApexSQL Doc 2005.13
ApexSQL Code 2005.13
ApexSQL Code 2005.05 - Supports legacy VBScript templates
ApexSQL Clean 2005.09
ApexSQL Log 2005.11
ApexSQL Script 2005.11
ApexSQL Report 2005.02

AUTHOR
Alexey Daryin

LAST REVIEW DATE
26 June 2009

Labels:

...


How do I get my Hardware ID?

DESCRIPTION
This article describes the different ways you can get your hardware ID.

What is a hardware ID?
A hardware ID is a string containing a set of numbers, characters, and/or symbols that uniquely identifies your computer/server. A Hardware ID may look like this: kfEgHSUTRK=.

It is used by ApexSQL to identify the machine you activated your ApexSQL software on.

How do I get my machine's hardware ID?

1) You can get your hardware ID from the Activation Form that pops up when you start your ApexSQL software if you're using the trial version:



2) If the trial period of not software has not yet expired or if you're using an already activated software, you can start the application and go to Help | About to get the hardware ID:



3) If for any reason you can't access any of the above forms because you can't start your ApexSQL Software, install another ApexSQL application using the ApexSQL Installer. Next, use #1 or #2 to get the hardware ID.

4) For ApexSQL Log and ApexSQL Recover, what's activated is the server. To get the hardware ID of the server, you must first be able to connect to the server successfully. Next, use #1 or #2 to get the hardware ID.

If the trial period has expired and you are unable to successfully connect to the server, execute the following commands on your SQL Server:

a) For ApexSQL Log 2005
EXEC master.dbo.xp_ApexSqlLog 20061002

b) For ApexSQL Log 2008
EXEC master.dbo.xp_ApexSqlLog2008 20061002

c) For ApexSQL Recover
EXEC master.dbo.xp_ApexSqlRecover2008 20061002

Note that ApexSQL Log or ApexSQL Recover must be installed to execute these statements.

5) For ApexSQL Report that's not activated, you will see the following text on the main page: "Freeware version. Trial period for full version expired. Activate Now." Click Activate Now to get the hardware ID.

AUTHOR
Janice Lee

LAST REVIEW DATE
18 June 2009

Labels:

...


How to subscribe to a forum topic

DESCRIPTION
This article should help you subscribing to the desired forum topic if you are registered on the forum.

SOLUTION
To subscribe to the desired forum topic you need to perform the following steps:
1) Open forum topic link in internet browser application (all popular browsers are supported, like IExplorer 6.x - 8.x, Firefox 3.x ...)
2) Check the bottom of the page and locate "Watch the topic for reply" link:



3) Click on the link, and after short period confirmation message box will pop up:



As result of subscribing process, you will get notified of the forum update via email.

AUTHOR
Dejan Apostolovic

LAST REVIEW DATE
18 June 2009

Labels:

...


Geting started with ApexSQL Console

DESCRIPTION
This article will help you getting started with ApexSQL Console applications or CLI (Command Line Interface) applications.

SOLUTION
The ultimate engineering need today, when working with databases, is to schedule and run different database jobs unattended, overnight, at predefined time etc. directly on database servers...
The perfect way to do that job is to use Console applications, because they consume less memory then GUI counterpart, and typically are easy controllable and manageable just by using several lines of text or even better using the .BAT files or batches.

ApexSQL has a rich set of products coming together with the CLI (Command Line Interface) Support. The CLI applications are designed as separate executables having the .com extension. For instance in the case of ApexSQL Diff we are having the 2 executables:
* One for the GUI (Grapic User Interface) application—ApexSQLDiff.exe, and
* One for the CLI application—ApexSQLDiff.com.

As you may notice these extensions are standard for all ApexSQL applications.

Being practical let us make a simple examination of typical ApexSQL CLI application. We can demonstrate all important elements of the typical ApexSQL application in a case of ApexSQL Diff.

How to instantiate the console application?
* We just need to open the Windows Console (in my case found at C:\Windows\system32\cmd.exe)
* Go to the ApexSQL Diff application folder (or make sure that the environment variable PATH has a link to the ApexSQLDiff.com application)
* Call either
ApexSQLDiff.com ...
or
ApexSQLDiff ...
followed the switches, parameters we want.

How to dump all the switches ApexSQL Diff provides.
We can use the following line:
ApexSQLDiff.com /help
and we will get...
ApexSQL Diff 2008.07, Copyright (C) 1999-2009 ApexSQL LLC

Connection Options:
/s1:arg [ /server1 ] : source server name ("(local)" if omitted)
/s2:arg [ /server2 ] : destination server name ("(local)" if omitted)
/d1:arg [ /database1 ] : source database name
/d2:arg [ /database2 ] : destination database name
/u1:arg [ /user1 ] : source login (trusted connection if omitted)
/u2:arg [ /user2 ] : destination login (trusted connection if omitted)
...

Additional options:
/? [ /help ] : prints help message
/af:arg [ /argfile ] : an XML file with options
/cw:arg [ /console_width ] : specifies the width of console output
/f [ /force ] : overrides existing file of same name
/out:arg [ /out_to ] : redirects console output to specified file
/t [ /test ] : outputs parsed command line switches without
taking any actions
/v [ /verbose ] : prints messages that are suppressed by default

Here we have shortened the whole instruction set and provided only several lines as a showcase.

Organization of the switches
Important to notice; every ApexSQL application has a set of instructions organized into groups.

In the case of ApexSQL Diff we are having the following groups:
* Connection Options:
* Specific Options:
* General Synchronization Options:
* Structure Comparison Options:
* Structure Synchronization Options:
* Structure Reporting Options:
* Additional options:

The instruction groups differ from product to product, but what is important the grouping helps a lot in cases we need to find some particular instruction; it will be easy to navigate the specific instruction by recognizing its group...

Also note that these three instruction groups:
* Connection Options,
* Specific Options, and
* Additional Options
are the “three amigos” (instruction groups being present in every ApexSQL console application).

The Format of Switches
1. Switches are case insensitive, i.e. /S: = /s:
2. Switches are preceded with one forward slash (/), i.e. /db:pubs.
3. Switches are followed with a colon (:), i.e. /db:pubs.
4. There are two types of all switches - abbreviated/alias (1-3 chars) and Full - with full name of switch. i.e. /p and /project
5. Default values for omitted parameters are used in most cases. Default values are specified in the following format in /help switch ("" if omitted), i.e. ("(local)" if omitted) as illustrated in the following example.

Passing Values to switches
1. Values should be passed to switches in the following format (see examples).
apexsqldiff.com /switch:value
apexsqldiff.com /switch:"value with spaces"

2. Use Double quotes for values that contain spaces.
3. Do not put a space between the colon and the value

How can we automate ApexSQLDiff.com?
We can achieve that by the help of .BAT files or batches. See the SEE ALSO section.

Where I should find the help for the CLI instructions
Every ApexSQL CLI supported application has a corresponding Command Line section in its help. For example the help for ApexSQL Diff application has a top level section "Command Line" describing all the command line options, switches, examples, etc.

Is GUI having more instructions then CLI?
No. GUI and the CLI should have the same number of instructions. In general everything you can do from the GUI, it can be done from CLI.


SEE ALSO
How to schedule CLI command execution with Windows Scheduler


LAST REVIEW DATE
May 22 2009

Labels:

...


The ApexSQL Installer

The ApexSQL Installer is a universal installer that installs most of ApexSQL's tools.


Where can I download the Installation Setup
The installer can be downloaded here.

Installation Types
There are several predefined installation types in the setup:

Default installation – All client applications/utilities are selected for installation
Custom Installation – The user selects specific applications to install
ApexSQL Universal Studio (Full Installation) - installs all applications, Add-ins and APIs which are all included in ApexSQL Universal Studio. This is equivalent to a Full Installation
ApexSQL Developer Studio - installs all tools included in ApexSQL Developer Studio
ApexSQL SSMS Plus - installs all tools included in ApexSQL SSMS Plus
ApexSQL Recovery Studio - installs all tools included in ApexSQL Recovery Studio
ApexSQL Comparison Studio - installs all tools included in ApexSQL Comparison Studio
ApexSQL DBA Studio - installs all tools included in ApexSQL DBA Studio



Note: None of the above includes ApexSQL Report, ApexSQL Audit Viewer, ApexSQL Snapshot Utility, and ApexSQL Log and ApexSQL Recover's server-side components.

Which applications cannot be installed using the ApexSQL Installer?
ApexSQL Report, ApexSQL Audit Viewer, ApexSQL Snapshot Utility, and ApexSQL Log & ApexSQL Recover's server-side components (client-side components can be installed using the ApexSQL Installer).

Where can I download the installers for applications that are not included in the ApexSQL Installer?

ApexSQL Report
ApexSQL Audit Viewer
ApexSQL Snapshot Utility

You will be prompted to install the server-side components of ApexSQL Log and ApexSQL Recover when you start using the app and connect to a server.



Which applications should I select to install?

To install individual applications
Check the box corresponding to the application you want to install.





To install a bundle
Select the bundle from the installation type. Below matrix shows which tools will be installed per selected bundle.



To install the server-side components of ApexSQL Log and ApexSQL Recover
Start each application. You will be prompted to install the server-side components when you connect to a server that doesn't have the server-side components installed.

If you encounter problems installing on a remote server, download the individual installers of ApexSQL Log and/or ApexSQL Recover. Read Installing server-side components only to a remote server for more information.

Can I use the ApexSQL Installer to upgrade my application to the most recent version?
Yes. ApexSQL Installer is updated every time there is a new product or a new version. Simply download the installer again and select the application that you want to install.

Can I use the ApexSQL Installer to install an older version of a particular application?
No. The ApexSQL Installer is updated every time there is a new version.

Where can I download the installers to old versions?
Installers to old versions can be found here: http://www.apexsql.com/training/2009/06/download-links-to-old-versions.htm.

Labels:

...


How to schedule CLI command execution with Windows Scheduler

DESCRIPTION
This article describes how to create Windows BATCHES (.bat files) that will allow us to schedule ApexSQL application tasks unattended, overnight, and like.
SOLUTION
In this example, we schedule a task to run Monday through Friday at 3:00 AM.

1. Create batch (*.bat) file containing the ApexSQL CLI command.

For example, here is a sample CLI command:

CODE:
APEXSQLPRODUCT.COM /S:TESTSERVER /D:TESTDB /SQL:<FULL PATH>\RESULT.SQL /EXCLUDE_SYSTEM_TABLES /VERBOSE


Save this statement on a batch file (.bat).
2. Open Scheduled Tasks window from windows Control Panel
3. Click on the Add Scheduled Task link
4. Click on the Next button on the first wizard steps
5. Click on the Browse button on the next step:


6. Browse do the batch file created on step1 and select it
7. Specify scheduled task name and set perform this task Daily:


Click on the Next button
8. Set Start Time on the next steps and set Weekdays run configuration:


Click on the Next button
9. Set account and password which will execute scheduled task:


Click on the Next button
10. Check open advance properties checkbox and press on the Finish button:


11. Verify Task and Schedule tabs that everything is created correctly.

AUTHOR
Dmitriy Dyubchenko

LAST REVIEW DATE
12 February 2009

Labels:

...


How to schedule CLI command execution with SQL Server

DESCRIPTION
The easy way to schedule a CLI command is using SQL Server Agent via its jobs.
A job is a specified series of operations performed sequentially by SQL Server Agent. The job can perform a wide range of activities, including running Transact-SQL scripts, command-line applications and etc...

SOLUTION
Let’s create an example schedule for every Monday and Sunday, 11PM run:

1. Open SQL Server Studio and create a new job:


2. Add new step to the job and specify ‘Operating System (CmdExec)’ type for that.


3. Paste your CLI command into the ‘Command’ edit box:
CODE:
APEXSQLPRODUCT.COM /S:TESTSERVER /D:TESTDB /SQL:<FULL PATH>\RESULT.SQL /EXCLUDE_SYSTEM_TABLES /VERBOSE


The results of execution will be outputted to \result.sql. The existent result file will be overridden. There is no possibility to append current output to existent result so far.

4. To run the job every Monday and Sunday, 11PM, create a new schedule for the job. On Schedules, click New.


Next, setup the schedule. To run every Monday and Sunday at 11:00 PM.


6. Save changes.

AUTHOR
Dmitriy Dyubchenko

LAST REVIEW DATE
12 February 2009

Labels:

...


Downgrading to a 2005 version of an ApexSQL Product

DESCRIPTION
How to downgrade to a 2005 version of an ApexSQL product

In the case where you have inadvertently upgraded to a 2008 version of an ApexSQL app but you don't want to purchase the upgrade, you will need to downgrade.

SOLUTION

1) You should uninstall the New ApexSQL .
2) Next, download and install the Old ApexSQL from here.
3) After downgrading, turn off the Auto-updater to avoid being prompted to upgrade again. Here is a KB article on how to do this.

Note: In case you want to downgrade ApexSQL Edit 2008, BEFORE downgrading you should manually unregister ssapi.dll. You can perform this by executing CLI command:

regsvr32 /u "C:\Program Files (x86)\ApexSQL\ApexSQLEdit2008\ssapi.dll"

where C:\Program Files (x86)\ApexSQL\ApexSQLEdit2008 is ApexSQL Edit 2008’s installation catalog.


SEE ALSO
ApexSQL Diff 2008 Upgrade FAQ
ApexSQL Log 2008 Upgrade FAQ

Brian Lockwood

Last Review Date
January 18, 2010

Labels: , ,

...


How to turn off the Application Auto-Updater

DESCRIPTION
This article will show you how to turn off the ApexSQL Auto-update feature. This is helpful if you don't want to upgrade to a new major version for example.

SOLUTION
Click Help -> Check for Updates menu item.



This will display the Automatic Check for updates dialog. Click Options



Next you will see the options dialog. Uncheck Automatically Check for updates on Application Startup.



The application will no longer automatically check for new updates and prompt for upgrades.

SEE ALSO
General FAQs

Brian Lockwood

LAST REVIEW DATE
05 Jan 2009

Labels:

...


Silent installation and un-installation of the ApexSQL products

SUMMARY
How to perform a silent installation and un-installation of the ApexSQL products.

RESOLUTION
To do the ApexSQL application installation/un-installation in silent mode, the following instructions should be done:

a. Installation:
To use the silent mode installation, use CLI with the following switches:

/VERYSILENT – this suppresses all installation wizard dialogs
/SUPPRESSMSGBOXES – this suppresses all messages from the installer
/LOADINF="filename" – this will load the previously saved installer settings (such as the installation directory, shortcuts and so forth…)
/SAVEINF="filename" – this will save all of your choices during an “ideal” installation (these choices will then be used in LOADINF switch)

Create an .inf file that will retain all choices of the wizard:
1) Start ApexSQL installer with SAVEINF switch
ApexSqlEdit.exe /SAVEINF="edit.inf"

This will save all your choices to the .inf file.
For example, the edit.inf contains the following info (then it can be edited manually):
[Setup]
Lang=default
Dir=D:\Program Files\ApexSQL\ApexSQLEdit1456
Group=ApexSQL\ApexSQL Edit1459
NoIcons=0


2) Use the following switches and the .inf file created on the previous step.

For example:
ApexSqlEdit.exe /VERYSILENT /SUPPRESSMSGBOXES /LOADINF ="edit.inf"

b. Un-installation:
To un-install your ApexSQL software, use the uninstaller program (unins000.exe) that accepts optional command line parameters. These can be useful to system administrators, and to other programs calling the uninstaller program.
/SILENT, /VERYSILENT

When specified, the uninstaller will not ask the user for startup confirmation or display messages stating that uninstall is complete. Shared files that are no longer in use are deleted automatically without prompting. Any critical error messages will still be shown on the screen. When '/VERYSILENT' is specified, the un-installation progress window is not displayed.
If a restart is necessary and the '/NORESTART' command isn't used (see below) and '/VERYSILENT' is specified, the uninstaller will reboot without asking.

/SUPPRESSMSGBOXES

This parameter instructs the uninstaller to suppress message boxes. It has effect only when it’s combined with '/SILENT' and '/VERYSILENT'. See '/SUPPRESSMSGBOXES' under Setup Command Line Parameters for more details.

/LOG

Causes Uninstall to create a log file in the user's TEMP directory detailing file uninstallation and [UninstallRun] actions taken during the un-installation process. This can be a helpful debugging aid.
The log file is created with a unique name based on the current date. (It will not overwrite or append to existing files.)
The information contained in the log file is technical and therefore not intended to be understandable by end users. Nor is it designed to be machine-parseable; the format of the file is subject to change without notice.

/LOG="filename"

Same as /LOG, except it allows you to specify a fixed path/filename to use for the log file. If a file with the specified name already exists it will be overwritten. If the file cannot be created, Uninstall will abort with an error message.

/NORESTART

This parameter instructs the uninstaller not to reboot even if it's necessary.
So you can just specify /VERYSILENT and /SUPPRESSMSGBOXES switches to the ApexSQL uninstall program.

Example:
Unins000.exe /VERYSILENT



AUTHOR
Konstantin Pogosov

LAST REVIEW
25 August 2008

Labels:

...


How do I email the output of a scheduled CLI job (e.g. reports, log files)?

DESCRIPTION
To email the output of a scheduled CLI job, use a SQL Server job.

SOLUTION

I. In SQL Server 2005, execute the following steps:
1. Configure mail profile and account on your database server:

CODE:
EXEC SP_CONFIGURE 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC SP_CONFIGURE 'Database Mail XPs', 1;
GO
RECONFIGURE
GO

EXEC MSDB.DBO.SYSMAIL_ADD_PROFILE_SP
       @profile_name = 'DBProfile',
       @description = 'Profile used to send mails.' ;
GO

EXEC MSDB.DBO.SYSMAIL_ADD_ACCOUNT_SP
      @account_name = 'DBAccount',
      @email_address = 'DBAccount@localhost',
      @display_name = 'Mail from Server',
      @mailserver_name = '',
      @username = '',
      @password = ''
GO

EXEC MSDB.DBO.SYSMAIL_ADD_PROFILEACCOUNT_SP
      @profile_name = 'DBProfile',
      @account_name = 'DBAccount',
      @sequence_number = 1
GO


Where:
- SMTP server from which e-mail will be sent
- e-mail account on SMTP server
- password for e-mail account

Database Mail may be configured manually from Microsoft SQL Server Management Studio:



More detailed information can be found: here

2. Create an ApexSQL CLI statement that outputs the results to a SQL file. Create a job based on this statement. See How to Schedule a CLI job using SQL Server for more information.

3. Using the same job, create another step with 'Transact-SQL (T-SQL)' type and paste the following to 'Command' edit field:

CODE:
EXEC MSDB.DBO.SP_SEND_DBMAIL
      @profile_name = 'DBProfile',
      @recipients = '',
      @subject = 'Mail from DB',
      @file_attachments = '\result.sql'


Where:
@recipients - Is a semicolon-delimited list of e-mail addresses to send the message to.
@subject - Is the subject of the e-mail message. If no subject is specified, the default is 'SQL Server Message'.
- is the e-mail to which results of audit will be sent
\result.sql' - is the full path to audit's result

4. Schedule the job to run on a schedule. See How to Schedule a CLI job using SQL Server for more information.

II. Click here to get more information on how to do this in SQL Server 2000.

AUTHOR
David Dawson

LAST REVIEW DATE
06 November 2007

Labels:

...


Regular expressions patterns for objects filtering

DESCRIPTION
Regular expressions are used to specify patterns for text searching and processing. This KB discusses regular expressions and how to use them for object filtering in ApexSQL Tools.

Definitions

A regular expression (regex or regexp for short) is a special text string for describing a search pattern.

A match is the piece of text, or sequence of bytes or characters that pattern was found to correspond to by the regex processing software.

A word character is an alphanumeric character in the alnum class or an underscore (_).

A word boundary is generally defined as a location where there is a "word character" on one side, and not on the other and designated by \b.

Assertions

Assertions specify the position of match for the pattern:

\b - A match must occur at a word boundary

a. \b(Cu) matches the tables with the names starting with “Cu”



b. (Currency)\b matches the tables finished with “Currency”



\B - Specifies that the match must not occur on a \b boundary.

a. (History) matches tables with names containing “History” substring anywhere



b. (History)\B matches tables containing “History” in the middle



^ - Specifies that match must occur at the beginning of a string.



$ - Specifies that match must occur at the end of a string.



For more information on assertions please refer to: http://msdn2.microsoft.com/en-us/library/h5181w5w(VS.71).aspx

Character Class

A Character class is a pattern in a regular expression that matches any of a set of characters. To match an “a” or an “e”, use [ae]. You could use this in gr[ae]y to match either “gray” or “grey”. The order of the characters inside a character class does not matter.



a. The \b(C[ou][ulnr])\w+ pattern matches the strings that start with the “C” character followed by second “o” or “u” characters followed by third “u”, “l”, “n” or “r” characters and followed by one or more word characters.



b. The Sales…son pattern matches the strings containing substring “Sales” followed by any three characters followed by “son” substring.



Grouping Constructs

Grouping constructs allow you to capture groups of sub-expressions.



a. The \b(Sales) pattern matches to strings started with “Sales”



b. The \b(?!Sales)\w+\b matches strings that not started with “Sales”



c. The Sales(?!Person) pattern matches strings containing “Sales” substrings followed by any but “Person” substring.



Quantifiers

Quantifiers add optional quantity data to a regular expression. A quantifier expression applies to the character, group, or character class that immediately precedes it. The .NET Framework regular expressions support minimal matching ("lazy") quantifiers.



a. The (Product){2} pattern matches strings with exact two “Product” substring repetitions.



b. The (Product)+ pattern matches the strings with at least one appearance of “Product” substring.



Escape Characters

An escape character signals to the regular expression parser that the character is not an operator and should be interpreted as a matching character.
The escaped character \b is a special case. In a regular expression, \b denotes a word boundary (between \w and \W characters) except within a [] character class, where \b refers to the backspace character.
In a replacement pattern, \b always denotes a backspace.



Filtering objects with the regular expressions in ApexSQL applications

The result object selection set is a union of those subsets that are specified by the regular expressions patterns.

For example the pattern S[^h]\w+ specifies a string where “S” character is followed by any character but “h” after which any word character may exist:



The pattern S[^a]\w+ specifies a string where “S” character is followed by any character but “a” after which any word character may exist the:



As a result the total objects selection specified by applying both of the patterns includes sub-sets that were excluded by each of the patterns.



More information

1. Teach Yourself Regular Expressions in 10 Minutes by Ben Forta
2. Mastering Regular Expressions by Jeffrey Friedl
3. MSDN Library: Regular Expressions Language Elements

AUTHOR
Irene Sanford

LAST REVIEW DATE
31 August 2007

Labels:

...


How to execute large SQL scripts

DESCRIPTION
ApexSQL can generate huge SQL scripts (e.g. synchronization script generated by ApexSQL Diff and ApexSQL Data Diff, undo or redo scripts generated by ApexSQL Log, or recovery scripts generated by ApexSQL Recover, etc). SQL Server utilities such as SQL Server Management Studio's query editor may not be able to open and execute these files.

SOLUTION
Note: You can run these scripts using the following:

a. Use the osql (or sqlcmd) command line utility that comes with SQL Server.

osql -H <host> -S <server> -U <user> -P <password> -i <path>

b. Use sqlcmd

sqlcmd -S <computername\instancename> -i <path> -o <output>

c. Use the script utility from ApexSQL

-Download the script utility here.
-Unzip it to any folder
-Go to the command line and navigate to the folder where you unzipped the zipped file
-Run utility with the following parameters:

ApexSqlRunScript server database script_to_run (file with complete path)


LAST REVIEW DATE
30 August 2007

Labels: , , , ,

...


How to Create a SQL Server/Data Source Alias

DESCRIPTION
This KB article describes how to create a data source alias. This is especially useful when you want to create your own connection strings or when you want easier-to-remember server names.

SOLUTION
1. Open SQL Server Configuration Manager:



2. On SQL Native Client Configuration, right-click Aliases and click "New Alias":



3. Below is an example of a filled-up Alias properties dialog. Click "Apply":



4. You can now type the Alias on any of ApexSQL tools' server list:



SEE ALSO
How to Create a Server Alias

AUTHOR
Janice Lee

LAST REVIEW DATE
21 August 2007

Labels:

...


What to do with large log files due to index rebuilds

DESCRIPTION
Index rebuilds can create very large log files. This KB discusses what to do when this happens.

SOLUTION
1) Make sure the database has a LOT of empty space in it. As in 1 to 2 YEARS worth of estimated growth if it is an active database, or double current space if it is slowly changing. This will allow the index rebuild/reorg process to lay the data/index pages down in contiguous order - as in not fragmented right off the bat. Trying to defrag a full database is a fruitless excercise!

2) Defrag only stuff that is currently highly fragmented. The standard for this is > 30%. See BOL for a script you can use plug-and-play. I also skip very small tables (< ?? pages in size, where ?? is either 50 or 100 depending on the phase of the moon :)

3) Assuming you have a very fragmented system due to not having sufficient space, open up free space and then CONTROL the first few rebuilds. Split up your tables into different runs so as not to create a huge log at one time. Be sure to backup the tlog between runs to flush committed entries and free space.

SEE ALSO
Excessive DAT Files

AUTHOR
TheSQLGuru

LAST REVIEW
30 August 2007

Labels: ,

...

© 2010 ApexSQL Tools All Rights Reserved | 1.919.968.8444 | Contact Us | Terms of Use | Privacy Policy