Apex SQL Audit
Apex SQL Clean
Apex SQL Code
Apex SQL Data Diff
Apex SQL Debug
Apex SQL Diff
Apex SQL Diff API
Apex SQL Doc
Apex SQL Edit
Apex SQL Enforce
Apex SQL Log
Apex SQL Log API
Apex SQL Recover
Apex SQL Refactor
Apex SQL Report
Apex SQL Script
Apex SQL Source Ctl
Apex SQL SSIS Compare
Knowledgebase Home
Can ApexSQL Edit 2005 and 2008 use the same Source Control project?
How to configure What Is dialog to remain opened even if it loses focus
How to start logging feature of ApexSQL Edit 2008
How to transfer ApexSQL Edit formatting options between computers
How to configure Microsoft Visual SourceSafe to work with native Source Control drivers
Upgrading from ApexSQL Edit 2005 to ApexSQL Edit 2008
How to create a new Source Control project using ApexSQL Edit
How to map a database to a Source Control System via MSSCCI driver using ApexSQL Edit.
Configuring ApexSQL Edit to work with ApexSQL Source Control
Subversion setup – the quick and easy way
ApexSQL Source Control – the fast track to Subversion integration! (for ApexSQL Edit)
How to Setup Source Control in ApexSQL Edit
Quickly Edit Queried Data Using Drill Down
|
ApexSQL Knowledgebase Tips and How-to Articles for Apex SQL Tools Can ApexSQL Edit 2005 and 2008 use the same Source Control project? DESCRIPTION This article describes how to map your database to a Source Control system project if you want to use ApexSQL Edit 2005 and ApexSQL Edit 2008 at the same time. SOLUTION If you want to run ApexSQL Edit 2005 and 2008 at the same time and use the Source Control functionality for a database mapped to a Source Control project, then you should map your database to different Source Control projects in each ApexSQL Edit version. One Source Control project should be used by ApexSQL Edit 2005 and the other one by ApexSQL Edit 2008 as on the screen shot below: Such a configuration is required because both application versions handle database mappings in a different way. Using the same Source Control project for both application versions will result in a non consistent status of database objects mapped to a Source Control system. Note: If you upgrade ApexSQL Edit 2005 to 2008 you should remap your database to allow the new application version manage correctly a database mapped to a Source Control system. Just remove database mapping and then map your database to a Source Control again. SEE ALSO Configuring ApexSQL Edit to work with ApexSQL Source Control AUTHOR Anna Lesniak LAST REVIEW DATE 22 June 2009 Labels: Apex SQL Edit, Apex SQL Source Control ...How to configure What Is dialog to remain opened even if it loses focus In ApexSQL Edit 2008, What Is dialog closes when it loses focus. This is default behavior. However, users might want to change such behavior and keep What Is dialog opened even if it loses focus. SOLUTION To keep What Is dialog opened even if it loses focus, you should perform the following steps: 1) Open "AllSettings" dialog using Ctrl + Shift + S hot-key combination 2) Locate property "WhatIsCloseOnDeactivate" Fastest way to accomplish this is by filtering "Setting" column by entering part of the property name/full name: ![]() 3) Change property value in "Value" column from "true" to "false" (without quotes) and close the dialog. ![]() After this procedure, What Is window should remain open even if it loses focus. AUTHOR Dejan Apostolovic LAST REVIEW DATE 10 June 2009 Labels: Apex SQL Edit ...How to automatically change the case of SQL keywords into uppercase when they are typed in a Query Editor window? DESCRIPTION This article describes how to configure ApexSQL Edit to automatically change the case of SQL keywords in SQL statements to uppercase without using the reformatting feature. SOLUTION It is possible to configure ApexSQL Edit to change automatically SQL keywords typed in a Query Editor window into uppercase. Just press the Ctrl+Shift+S keyboard shortcut to display the All Settings dialog box. Find the UpperCaseReservedWords setting (you can filter all settings by typing the text ‘*Upper*’ in the filter row of this dialog box, like displayed on the screen shot below) and change its value to True. ![]() From now on, all your SQL keywords will be changed to uppercase after they are typed in a Query Editor window and after the Enter key is pressed at the end of the line, like displayed on the screen shots below: SQL keywords before pressing the Enter key: ![]() SQL keywords after pressing the Enter key: ![]() Note: You can also change the case of the whole text typed in a Query Editor window to uppercase, lowercase and ‘proper’ case using the Ctrl+U keyboard shortcut. This keyboard shortcut can be applied to comments included into your SQL scripts or to scripts themselves, if your database is not case sensitive. Just select the text you want to change and press Ctrl+U: ![]() The marked text will be changed to uppercase. ![]() Press the U key again holding down the Ctrl key and the text will be changed to lowercase: ![]() Press the U key again holding down the Ctrl key and the text will be changed to ‘proper’ case: ![]() The Ctrl+U keyboard shortcut works in a round robin way. SEE ALSO ApexSQL Refactor ApexSQL Edit Help - Formatting options AUTHOR Anna Lesniak LAST REVIEW DATE 15 June 2009 Labels: Apex SQL Edit ...How to start logging feature of ApexSQL Edit 2008 In ApexSQL Edit 2005, logging feature was always active, recording problems encountered when using the application. This log file was helpful to the developers to locate cause of problems experienced by customers. In ApexSQL Edit 2008, this feature is turned Off by default. This article should help you turning ON logging feature of ApexSQL Edit 2008. SOLUTION To turn ON logging feature in ApexSQL Edit 2008, you should perform the following steps: 1) Locate at your desktop the shortcut you are using for starting the application 2) Highlight it and open its properties (right-click the shortcut and click the Properties command from the context menu) 3) Locate the Target input box and modify its content by adding " log" (without quotes) at the end. In example, change: "C:\Program Files\ApexSQL\ApexSQLEdit2008\ApexSQLEdit.exe" to "C:\Program Files\ApexSQL\ApexSQLEdit2008\ApexSQLEdit.exe" log ![]() 4) Click the OK button to save changes Next time you start the application, "apexsqledit.log" file will be created in the installation folder (in the example: "C:\Program Files\ApexSQL\ApexSQLEdit2008") ![]() AUTHOR Dejan Apostolovic LAST REVIEW DATE 04 June 2009 Labels: Apex SQL Edit ...How to transfer ApexSQL Edit formatting options between computers This Knowledgebase article discusses how to transfer ApexSQL Edit formatting options between computers. This can be very useful if you are using several computers (in example, work station in the office and laptop at home). SOLUTION In ApexSQL Edit 2008, to be transfer formatting options between computers, you must perform the following steps: 1) Open Formatting options dialog on "source" computer (computer where you have desired formatting options). You can do this via Tools | Formatting Options command or by pressing Ctrl + F8 key combination. 2) Click Export button to create and save FormattingSettings.xml file on desired location: ![]() Default location for saving formatting options file is ApexSQLEdit2008 folder in My Documents\ApexSQL folder, like: C:\Documents and Settings\{windows_user_name}\My Documents\ApexSQL\ApexSQLEdit2008\ ![]() 3) Copy file created to "destination" computer (computer which formatting options you wish to make equal to formatting options on "source" computer). 4) Open Formatting options dialog on "destination" computer. 5) Click Import button and browse to FormattingSettings.xml file you copied. ![]() 6) Click Apply command and close Formatting Options dialog. ![]() As result of this command, new formatting options will be applied and you will have formatting options on "destination" computer equal to formation options on "source" computer. AUTHOR Dejan Apostolovic LAST REVIEW DATE 26 May 2009 Labels: Apex SQL Edit ...Why I'm experiencing slowdowns in ApexSQL Edit Schema Explorer after mapping a database to a Source Control. DESCRIPTION After my database is mapped to a Source Control system and actions like: • adding a new object to a Source Control system or • refreshing a database folder are run, then, ApexSQL Edit can work significantly slower and can consume the substantial amount of system resources if a database contains many mapped objects. SOLUTION The current implementation of ApexSQL Edit retrieves many detailed information about the state of each mapped object, when you are working with the Schema Explorer. It checks for example: • if database objects differ from their Source Control versions, • if objects are checked out and by whom (and others). This process can be resource/time consuming, if many database objects are mapped to a Source Control system. You can do the following to avoid delays: • Map only the necessary objects to your Source Control system. • Additionally, when you are mapping your database to a Source Control system, choose NOT to remember a password for a Source Control user. Each next time you start ApexSQL Edit, just CANCEL the dialog box asking about a Source Control user password. Your Source Control system will be unavailable and the application will display the password dialog box at time to time, but the Schema Explorer will work faster. Note: We are working on a completely new approach to ApexSQL Edit / Source Control integration. The new design should fix many current issues, also those related to slowdowns in the Schema Explorer. Please check our Developers Blog for the newest information about the work progress. SEE ALSO Configuring ApexSQL Edit to work with ApexSQL Source Control How to create a new Source Control project using ApexSQL Edit AUTHOR Anna Lesniak LAST REVIEW DATE 25 May 2009 Labels: Apex SQL Edit, Apex SQL Source Control ...How to prepare an existing SourceGear Vault project to be mapped in ApexSQL Edit multi user environment. DESCRIPTION This article describes how to prepare an existing SourceGear Vault project to be mapped in ApexSQL Edit multi user environment. SOLUTION I assume that the axEdit_Repository was created in SourceGear Vault system to store projects for ApexSQL Edit. This repository has its working folder in the C:\Vault_WorkingFolder\axEdit_Repository_WF folder. I also assume that SourceGear Vault is used by two users. The first user mapped the axEdit_Dev database to the SourceGear Vault Server and assigned the database objects to the Vault repository. The second user would like to use already existing project in the Vault Repository. She should: a) assign a local working folder to an existing project using Vault Client. To enable ApexSQL Edit to work with already existing projects within SourceGear Vault, the second user needs first to create locally all Vault repository items (projects/folders and script files). She uses the Vault Client application and connects to axEdit_Repository. Then she selects the Set Working Folder command for the existing axEdit_Dev project. And she assigns a local folder as the project’s working folder: At the end she runs the Get Latest Version command for the axEdit_Dev project. This command will copy all files for the project (and its sub-projects) to the local working folder. Note: This configuration must be done to allow ApexSQL Edit working with existing projects defined in SourceGear Vault (existing Vault projects are not seen by ApexSQL Edit due to MSSCCI limitations unless they have at least one file inside). b) map a database and its objects to an existing project using the Map Database command and Source Control Mapping Wizard. SEE ALSO How to map a database to a Source Control System via MSSCCI driver using ApexSQL Edit AUTHOR Anna Lesniak LAST REVIEW DATE 25 March 2009 Labels: Apex SQL Edit, Source Control ...How to configure Microsoft Visual SourceSafe to work with native Source Control drivers DESCRIPTION This article describes important Microsoft Visual SourceSafe post installation steps and how to use it from ApexSQL applications. SOLUTION We will cover the usage of Microsoft Visual SourceSafe 2005 but it is very same with the older Microsoft Visual SourceSafe 6.x versions. In Microsoft Visual SourceSafe you should have databases to work with. Let's say our database name is Production. Each database has a corresponding location on disk. To get a location of your database use the VSS Administrator tool, click CTRL+O and you will get Open Source Save Database Dialog like at the image. ![]() As you can see from the image our Production database is located in the folder c:\installed VSSNow we should set this folder as a network share. If you are using XP system you should set the network easily as follows: ![]() ![]() If you are using Vista system you should make something like this. ![]() Now when the network share is set we are able to set the Microsoft Visual SourceSafe Source Control Data Source from ApexSQL applications... Setting up the connection to a Microsoft Visual SourceSafe project Here I used ApexSQL Diff application as a showcase, but in general connecting to a Microsoft Visual SourceSafe is similar throughout all ApexSQL applications supporting Source Control. 1. Choose a Source Control data Source type and click "Edit" ![]() 2. Select Microsoft Visual SourceSafe native driver ![]() 3. Set Microsoft Visual SourceSafe project access parameters ![]() Let’s explain the fields that are in the image: * The User and the Password are the user credentials for accessing the Microsoft Visual SourceSafe server. * The Database represents the path to a Microsoft Visual SourceSafe repository. It has the form HOSTNAME/REPOSITORY. HOSTNAME is a name of a Server machine where the Microsoft Visual SourceSafe server is installed; this name should be pingable from the network and it may be either NET BIOS name or the DNS name. REPOSITORY is a network share name from the HOST machine. * The Project is a Project you made within your Microsoft Visual SourceSafe database (here within Production database) * The Working Folder is some folder on your hard disk you have chosen to be your Microsoft Visual SourceSafe stub * The Version can be either "latest version" or some labeled version chosen from the drop down select box. You can always test the Connection using the Test button. In the case of problems you will receive the descriptive information about the problems when establishing a connection; otherwise you are ready to go. SEE ALSO Microsoft Visual SourceSafe LAST REVIEW DATE March 18 2009 Labels: Apex SQL Diff, Apex SQL Edit, Source Control ...Upgrading from ApexSQL Edit 2005 to ApexSQL Edit 2008 When upgrading existing ApexSQL Edit 2005, we recommend NOT uninstalling it. It is the best to install the ApexSQL Edit 2008 in the separate folder because both versions can coexist, on the same PC, without any problems. (This approach is useful in case user wants to transfer/recreate some files/settings from old version - i.e. projects and workspaces must be recreated because back compatibility is lost). The entire upgrade process should be as follows: - Install ApexSQL Edit 2008 first, without uninstalling the ApexSQL Edit 2005. ApexSQL Edit 2008 installation folder: ![]() ApexSQL Edit 2005 installation folder: ![]() - Transfer configuration settings from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 using following steps: 1. General/global application settings: copy Settings.xml from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 installation folder and rename it to Options.xml 2. Favorites: copy Favorites.xml from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 installation folder. 3. Queries: copy Queries.xml from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 installation folder. 4. Auto Replacements: copy Replacements.xml from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 installation folder. 5. Custom SQL Template commands: copy "SQL Templates" sub-folder from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 installation folder. 6. Report Templates: copy "Report Templates" sub-folder from the ApexSQL Edit 2005 to the ApexSQL Edit 2008 installation folder. 7. Snippets: “Place any custom or modified snippets into any directory other than "$My Documents$\ApexSQL\ApexSQLEdit2008". We recommend “$My Documents$\ApexSQL\ApexSQLEdit2008\Snippets\My Snippets" 8. Templates: “Place any custom or modified templates into any directory other than "$My Documents$\ApexSQL\ApexSQLEdit2008". We recommend “$My Documents$\ApexSQL\ApexSQLEdit2008\Templates\My Templates” 9. Files should be copied from the ApexSQL Edit 2005 isolated storage to the ApexSQL Edit 2008 Isolated storage as it preserves some of the features found in those files (i.e. the Quick Info, Custom Menus, Aliases, Tab Colors, etc). ApexSQL Edit 2005 isolated storage location is defined in the Options as follows: ![]() The isolated storage contains the following files: ![]() - ConnectionTabColors: Keeps information about query tab colors - CustomExplorers: Keeps information about explorers layout - CustomMenus: Keeps information about custom menus - DefaultConnections: Keeps information about default SQL connections ApexSQL Edit 2008 isolated storage location is defined in the Options as follows: ![]() Apart above, should be noted also that: - We have lost backwards compatibility for projects and workspaces; suggestion is to create them manually based on existing ones in ApexSQL Edit 2005 (unfortunately, there is no other solution) - Query Tab coloring (ConnectionTabColors.xml) must be recreated too (the ApexSQL Edit 2008 reads SQL Servers name differently compared to version 2005); suggestion is to: 1. From the ApexSQL Edit 2008, set color for SQL Server/database already configured in the version 2005, 2. Open the both ApexSQL Edit 2008 and ApexSQL Edit 2005 ConnectionTabColors.xml files in some text editor and note how SQL Server name is stored by ApexSQL Edit 2005 and by ApexSQL Edit 2008 3. If there are any differences, you should: a) perform “search & replace” in the ApexSQL Edit 2005 ConnectionTabColors.xml file and replace “old” server name with new one b) save modified file over existing one in the ApexSQL Edit 2008 isolated storage. AUTHOR Dejan Apostolovic LAST REVIEW DATE 16 March 2009 Labels: Apex SQL Edit ...How to create a new Source Control project using ApexSQL Edit DESCRIPTION This article describes how to create a new Source Control project using ApexSQL Edit. SOLUTION If your ApexSQL Edit installation is configured to use a Source Control system, you can create SC projects using ApexSQL Edit commands. I assume that Visual Source Safe 2005 Server is installed on VSS_SRV machine and SourceSafe Database VSS_2005DB is created on VSS_SRV. The VSS_2005DB database was assigned the VSS_WorkingFolder as its working folder. Before you create a project in a Source Control system, map your network path of the working folder (\\VSS_SRV\VSS_WorkingFolder) to a local drive letter. Note: Use local drive letter whenever you configure working folders for you source control projects. In this example I use the “K:” letter. To create a new Source Control project switch to Source Control pane and connect to your Source Control system (right click the Not logged in to Source Control and select Refresh) providing the appropriate login id and password. You can create a new project structure using the Create Project command from the context menu of your Source Control system. Enter a New Project Name of your project and accept it by clicking OK. In the example displayed below I create the axEdit_Dev project. It will be created in the VSS working folder, so in our example in the local drive K:\. ApexSQL Edit will automatically create the appropriate working folder structure. Note: When you create a new project it is important to set the working folder to the same folder as the Parent Project. The working folder for your project (axEdit_Dev) will be created automatically inside the folder displayed in the screen shot above as a Working Folder (K:\). If the Working Folder is set to a different folder than the Parent Folder, the folder for your new project will be created twice in both locations mainly due to the current MSSCCI provider implementation. To avoid such situation just use the procedure for creating working folders described in this article. After creating the main project you can add to it its sub-projects using the Create Sub-Project command to create a structure that will suits your needs. You can use the same method of creating projects and sub-projects when you work with the Source Control Mapping Wizard and you are creating a Default Mapping Project Path and when you are creating the Objects Mapping Folders. SEE ALSO Registering the ApexSQL Source Control Add-in Configuring ApexSQL Edit to work with ApexSQL Source Control AUTHOR Anna Lesniak LAST REVIEW DATE 10 March 2009 Labels: Apex SQL Edit, Source Control ...How to map a database to a Source Control System via MSSCCI driver using ApexSQL Edit. DESCRIPTION This article describes how to use the shared network path for working folders when setting up ApexSQL Edit via MSSCCI driver. SOLUTION I assume that Visual Source Safe 2005 Server is installed on VSS_SRV machine and SourceSafe Database VSS_2005DB is created on VSS_SRV. Suppose you would like to use \\VSS_SRV\VSS_2005DB\AdventureWorks network path as a working folder path for your Source Control projects used in ApexSQL Edit. Before you map a database to a Source Control system in the application, map your root network path \\VSS_SRV\VSS_2005DB to a local drive letter. In this example I use the “K:” letter. The local drive letter should be used instead of a network URL for definition of a mapping project working folder and database objects working folders, as network URLs can provoke unpredictable behavior of ApexSQL Edit. Run the Source Control Mapping Wizard by selecting the Map Database command from your database context menu. Select the Create New Mapping Project to map database objects to a Source Control System. Select one of the Source Control systems that use the MSSCCSI driver. In this example I use the Microsoft Visual SourceSafe system. When you define the mapping project working folder, use the local drive letter instead of a network URL, – in the example displayed below the AdventureWorks folder was created within the local K: drive: Similarly, the database objects working folders were created using the local drive letter - in the example displayed below each database object type is assigned to its own folder created within the mapping project working folder: The Wizard can be finished in a typical way. SEE ALSO Registering the ApexSQL Source Control Add-in Configuring ApexSQL Edit to work with ApexSQL Source Control AUTHOR Anna Lesniak LAST REVIEW DATE 10 March 2009 Labels: Apex SQL Edit, Source Control ...Configuring ApexSQL Edit to work with ApexSQL Source Control After registering ApexSQL Source Control Add-in, you have to configure Source Control Explorer options (Tools | Options | Source Control Explorer Options). As Source Control System you we choose Native Subversion in this example. ![]() ![]() Driver: Type of source control system to be used Host: Subversion server URL Login ID: name of the user that will be used when connecting to Subversion server Password: password to be used when connecting to Subversion server Repository: project to be used on Subversion server when using source control features Local Folder: location for storing local copies of files from repository ![]() After finish configuring Source Control Explorer Options, you can perform basic operations with repository from Source Control explorer as it is described in “Using Source Control Project” section of ApexSQL Edit Help file. See Also Subversion setup – the quick and easy way Registering the ApexSQL Source Control Addin Configuring ApexSQL Edit to work with ApexSQL Src Control Labels: Apex SQL Edit, Apex SQL Source Control ...Subversion setup – the quick and easy way The one of easiest ways to setup Subversion server is using VisualSVN Server package. VisualSVN Server is a 3rd party freeware package that contains everything you need to install, configure and manage Subversion server for your team on Windows platform. It includes Subversion, Apache and a management console. You can easily download VisualSVN Server from its official page at http://www.visualsvn.com/server. In this article, I will demonstrate how to install and configure Subversion (including repository and permissions), using VisualSVN and configure ApexSQL Edit to work with subversion, with the help of ApexSQL Source Control (plugin). 1) Installation VisualSVN Server is distributed as an all-in-one standard Windows Installer package. The installation process is quite easy and intuitive. There is only one configuration screen during the setup: ![]() Location: installation path for VisualSVN Server. Repositories: path where all Subversion repositories will be stored Server Port: port used for communication with server Authentication: authentication type that will be used when connecting to Subversion Server Use secure connection (https://): if secured connection will be used when connecting to Subversion server One of standard configurations is to use default locations for VisualSVN Server and repositories, 8080 for port (if it is not already used by other applications), unsecure connection and Subversion authentication. At the end of installation process you will be asked to run VisualSVN Server management console as shown on the screenshot below: ![]() 2) Management console VisualSVN Server provides a simple and intuitive management console implemented as a standard MMC snap-in. You can access it through Start | All Programs or through the standard Computer Management console. ![]() With the management console you can easily create new repositories and browse existing ones. It also allows you to manage access permissions for the repositories. Initially, VisualSVN Server has no repositories or users. Your first task is to create initial repository and user(s). 3) Repository management Repository management commands are accessible through the context menu of the VisualSVN Server/Repositories node: ![]() ![]() While creating a new repository VisualSVN Server can automatically create the default repository structure but it is not necessary - you can create appropriate structure from the ApexSQL Edit once you connect to Subversion Server. After creating the repository you need to setup permissions for your repository to allow access from the ApexSQL Edit (or any other application using ApexSQL Source Control). 4) Access permissions management VisualSVN Server can authenticate users in two ways: • using built-in Subversion authentication and • using standard Windows Authentication You can setup the preferred authentication type by choosing the Properties context menu command for the root element in the VisualSVN Server management console. By default, VisualSVN Server uses built-in Subversion authentication. With Windows Authentication you will be able to use local or Windows domain user accounts to connect to VisualSVN Server. With Subversion built-in authentication you need to create users accounts. ![]() ![]() User name: name of the user that will be used when connecting to Subversion server Password: password to be used when connecting to Subversion server Confirm password: password verify VisualSVN Server automatically sets up read/write access to all repositories for every authenticated user. Once you finish with repositories and users, you can connect to repository from the ApexSQL Edit. See Also Subversion setup – the quick and easy way Registering the ApexSQL Source Control Addin Configuring ApexSQL Edit to work with ApexSQL Src Control Labels: Apex SQL Edit, Apex SQL Source Control, Subversion ...ApexSQL Source Control – the fast track to Subversion integration! (for ApexSQL Edit) ApexSQL Edit 2008 allows for seamless integration with Subversion using ApexSQL Source Control add-on, however, this is not replacement for Subversion server itself. To use this functionality, a customer must already have working instance of Subversion Server. This three part Knowledge Base article will guide you through the steps to set up ApexSQL Edit 2008 to work natively with Subversion. Subversion setup – the quick and easy way Registering the ApexSQL Source Control Addin Configuring ApexSQL Edit to work with ApexSQL Source Control Labels: Apex SQL Edit, Apex SQL Source Control, Subversion ...How to Setup Source Control in ApexSQL Edit SOLUTION 1) Configuring options ![]() Before mapping database to Source Control you should configure ApexSQL Edit Source Control Explorer options. • Open Tools | Options | Source Control Explorer Options tab for setting up necessary options. • Source Control System: choose Visual Source Safe (Direct) value or other Source Control system you are using. • Source Safe Database: locate “srcsafe.ini” file for desired SS database. • Source Safe User: point out existing SS database username. • Source Safe Password: specify a password for the pointed out selected SS database user. • Press Ok to save options. • Restart application. 2) Map database ![]() In Schema Explorer locate database you want to map. From database context menu, chose Source Control | Map Database command. 3) Create new mapping project ![]() Create New mapping project and specify project name on this Wizard step. 4) Source Control Folder Mapping ![]() Soon as you enter and confirm VSS logging information, “Source Control Folder Mapping” dialog will pop up. On this dialog you can create project and select working folder for store mappings. If you like, you can create separate folder for each database object type. Press Select to proceed with other settings. 5) Database Type Mappings ![]() For each database object type you have to select project for script store. Of course, you can choose same project (location) for each database object type. However it is not best practice – separate locations are easier for further use. 6) Database Object Mappings ![]() Script desired database objects or entire types using Script Objects to Source Control context menu command. 7) Complete mapping process ![]() Right after final dialog close, you will be able to use Source Control feature for mapped database. Press Finish to finalize mapping project creation. 8) Using Source Control feature from Schema Explorer ![]() For any mapped database object you can perform SC related commands from Schema explorer context menu. 9) Using Source Control feature from Schema Explorer ![]() Some of Source Control related commands are accessible from Source Control explorer. 10) Using Source Control feature from query editor window ![]() Some of Source Control related commands are accessible from query editor window. AUTHOR Alexey Daryin LAST REVIEW DATE 20 August 2008 Labels: Apex SQL Edit ...Visual Query Editor This KB discusses how ApexSQL Edit's Visual Query Editor can speed up your T-SQL coding. DESCRIPTION In this article, we discuss the Visual Query Editor (VQE) of ApexSQL Edit and how you can get the most out of it. Activating the Visual Query Editor By default, the VQE is not activated automatically in ApexSQL Edit. To activate it, right-click on the menu/toolbar area and select "Customize": ![]() Go to the "Commands" tab and select the "Query" item from the Categories list. Scroll down the list of "Commands" and at the bottom you can find the "Visual Query" item: ![]() Drag and drop this item to the menu/toolbar area. Important: This is a one-time setup. Once set, the VQE can be accessed from the Main Menu or by hitting F11: ![]() The Visual Query Editor The Visual Query Editor can be divided into the following subparts: ![]() 1. The Query Building Area: This is the main area where the visual representation of the query is displayed. This area allows you to add database objects, define links among them, and configure properties of tables and links. 2. The Database Tree Pane: In this area, you may select the objects such as tables, views, or procedures that you want to build a query from. To build a query, simply drag and drop them on the Query Building Area. 3. The Columns Pane: This area is used to perform operations on your query output columns and expressions. You can define field aliases, sorting, grouping, and criteria. 4. The SQL Output Area: This is where the textual representation of the query will be displayed. Note that the VQE is a two-way tool. This means that the modifications done in the Query Building Area will always be reflected in the SQL Code Area and vice versa. Getting started To illustrate ApexSQL Edit's VQE, we use the Northwind Database. The first step in using the VQE is selecting the database object that your query will be based on. A database object is selected when, and only when, it is displayed in the Query Building Area. Again, this means that objects only exist in the VQE when they are shown in the Query Building Area. Suppose you have a query that's based on the Orders table. You have two ways to bring up the Orders table in the Query Building Area. The first way is to select the Orders item in the Database Tree Pane, drag it from there, and drop it to the Query Building Area. After dropping the Orders item, it will be displayed in the Query Building Area: ![]() The second way of adding objects to the Query Building Area is to use its context menu: ![]() By selecting the "Add Object" menu item, you open the "Add new object" dialog: ![]() This dialog contains three tabs--one for each object type that can be added to the VQE. You can browse this dialog just like any other list. If a database contains many objects in different schemas, the "Filter objects by Schema name" dropdown box can be used to limit the number of items displayed in the list. Objects can be filtered by the schema to which they belong: ![]() As displayed above, there is no user-defined schema in this version of the Northwind database. By selecting "(All objects)," the filter can be removed and all objects of the database will be displayed again. Once the object to be added to the Query Building Area is found, the corresponding item can be selected in the list. Then, click on the "Add Object" button, .The Query Building Area now looks more or less like below: ![]() To control the visibility of a column in the final SELECT list, simply check or uncheck it. In above example, CustomerID, OrderDate, and ShippedDate columns are selected and will thus be included in the SELECT list. By marking a column checked, it is instantly added to the Columns Pane and the SQL Output Area. Notice that the Order table item's caption in the in the Query Building Area shows (3)dbo.Orders. ApexSQL Edit automatically displays the number of checked columns. Using more than one table The VQE has the ability to identify the relationships among tables added to the Query Building Area. The result of dragging and dropping the [Order Details] table to the Query Building Area looks like this: ![]() The link between both table objects are shown above. By reading SQL Server's metadata, ApexSQL Edit determines that both table are in a 1:m (1 to many) relationship. Editing a selected database object Each SQL Server source code parser must be able to uniquely identify columns and tables in a query. Typically this is achieved by using the three part naming convention-- schema.table.column. Using this convention, it is immediately obvious which column belongs to which table. The syntax however adds complexity to the query definion and makes code hard to maintain. To simplify this, you may use table aliases for each table participating in the query. Consider the query below: SELECT DBO.[ORDER DETAILS].ORDERID, DBO.[ORDER DETAILS].PRODUCTID FROM DBO.[ORDER DETAILS] With a table alias, the query will look like this: SELECT OD.ORDERID, OD.PRODUCTID FROM DBO.[ORDER DETAILS] OD Although both queries are absolutely identical with respect to their execution plan and resultset, the latter is more readable. The beauty of using table aliases is made more obvious when using 4 or more JOINs. VQE supports table aliases. An alias for an object can be created by right-clicking on the object in the Query Building Area: ![]() From the context menu, choose "Edit...". This opens the "Datasource Properties" dialog: ![]() Enter the desired alias and click OK. The query immediately reflects the change introduced by the alias: ![]() Editing relationship properties This INNER JOIN is the default relationship used by the VQE. This can be changed by right-clicking the link between two tables: ![]() Then, choose "Edit..." from the context menu to add the "Link Properties" dialog: ![]() Above image shows the unmodified link property. The dialog is divided into a left and a right part with a linking operator between them. This is a visual presentation of the underlying SQL source code. Right below the object names, there are two checkboxes. With INNER JOINs, none of these checkboxes will be marked. Below the checkboxes is the column that joins the two tables. To change the INNER JOIN to an OUTER JOIN, mark that checkbox below the left table: ![]() You now have a LEFT JOIN from Orders on [Order Details]. In order to change this condition to another, select the appropriate operator from the dropdown box: ![]() Most of the common operators can be selected from the list. The Columns Pane The Columns Pane is the area in the VQE that's located directly below the Query Building Area: ![]() This grid contains all columns currently selected for output in the SELECT list or the columns used for sorting, grouping, or filtering. Each column has a corresponding checkbox, the check status of which determines its inclusion to the resultset. A column alias can also be specified for each column. You may-- -specify if the column should be included in an ORDER BY clausem ![]() -specify the ordinal position of the column in the ORDER BY clause, ![]() -or specify if an aggregate function should be applied to the column and whether the column should appear in the WHERE, GROUP BY, HAVING clause of the query: ![]() If a column is included in a WHERE clause, you may enter the condition into the "Criteria" field at the right of the "Group By" column: ![]() Editing Query Properties Next we discuss the Q in the Query Building Area: ![]() The "Query Properties" dialog can be reached via this symbol: ![]() In this dialog, you can specify if the TOP clause should be applied to the query, and whether a number of rows or a percentage of rows (with ties or not) should be returned. There are several other different aggregating functions available: ![]() Derived Tables The VQE in ApexSQL Edit fully supports derived tables. A derived table a virtual table that is derived from other base tables or views. Consider this: SELECT ORDERID FROM ORDERS The above query uses the base table Orders in the FROM clause. SELECT ORDERID FROM (SELECT ORDERID FROM ORDERS) AS T1(ORDERID) The second query uses a derived table in its FROM clause. Derived tables can be used where table expressions are allowed. To add a derived table to the Query Building Area, use its context menu: ![]() From the context menu, choose "Add Derived Table". This will add a new and empty table object item to the Query Building Area: ![]() Right-click the object's to bring up its context menu: ![]() Select "Switch to derived table" to add a new tab to the Query Building Area: ![]() The same functions, operations, and restrictions that apply to the main query applies to a derived table. ![]() Use the Customers table as our base table for your derived table. Switching back to the Main tab of the VQE, the following screen will be displayed: ![]() The derived table is now filled and joins Orders with [Order Details]. To relate Query1 to one or more of the other tables, drag the Query1 column to another table object and drop it over the target column. The relationship is now established: ![]() Adding UNION queries UNION queries are added in pretty much the same fashion as derived tables are added. Just open the Query Building Area's context menu and select "Union" -> "New Union Sub-Query": ![]() This again will result in a new tab opened in which you can generate your UNION query: ![]() Directly editing the SQL source code Again, the VQE in ApexSQL Edit is a two-way tool. Hence, editing the generated SQL code also affects its visual representation. Suppose you have an empty UNION sub-query in the Query Building Area, the the SQL code in the SQL Output Area will look like this: ![]() To remove it, simply remove it from the code. This modification immediately shows in the Query Building Area. Conclusion The VQE offers many advanced features that can't be found in other tools and it simplifies the writing of complex queries. AUTHOR Frank Kirkland LAST REVIEW DATE 13 August 2007 Labels: Apex SQL Edit ...Quickly Edit Queried Data Using Drill Down DESCRIPTION Using the new features of ApexSQL's Drill Down, the process of editing data from query results just got a lot easier. SOLUTION This solution will show how to use the the Drill Down feature to quickly edit data from queries. Using the Northwind database, we search the row from the Order table with Customer ID = VINET, Shipped Date = 1996-07-16, and Unit Price = $9.80. We need to update this record's unit price to $10.50. To begin, we run the following query: select Ord.OrderID, Ord.CustomerID, Ord.ShippedDate, Detail.UnitPrice This gives us the following results: ![]() By examining the rows shown, we see that the Shipped Date and Unit Price we are looking for is in the second row. At this point, we would need to start constructing an update statement. Instead of manually typing the update statement, we use ApexSQL's Drill Down. To do is, we simply find the column(s) that is/are unique to the table containing the record we want to update. In this example, the column is OrderID. Right click on the row and select Drill Down from the context menu. This will launch the Drill Down - Multi-Column dialog. Select the column(s) you wish to use to perform the Drill Down on and click OK. ![]() If only one column is needed for the Drill Down, you can bypass the Multi-Column dialog by double clicking on the column you want to use (in this case, OrderID). The Drill Down window (shown below) lists the tables that have the columns that you are "drilling" on. As you click a table in the list on the left, column values from the row you started the Drill Down from will be listed out on the grid. Click on the Order Details table and we will see in row 2 the Unit Price that we need to change. Click on the cell and type in the new value of $10.50. After you change the value, scroll down to the changed row. Notice that the background of the cell that was just changed has changed. This has not been committed to the database. Press the Update button to commit the change or the Refresh button to discard your changes. Once you press the Update button you are done. Click OK to close the window. Your record has been updated. AUTHOR Stephen Schmidt LAST REVIEW DATE 27 August 2007 Labels: Apex SQL Edit ...Visually Differentiating Databases through Tab Colors DESCRIPTION Many workplaces replicate the same database several times for Development, Testing, and Production purposes. Even when being "really careful," it is easy to mistake the active Production database window for the Development database. ApexSQL Edit allows you to visually differentiate your databases through colored tabs. This KB article discusses how you can use this feature to avoid the mistake of executing an SQL statement against the wrong version of your database. SOLUTION To illustrate, we use three versions of the Northwind Database: NorthwindProd (production DB), NorthwindTest (testing/validation DB), and Northwind (development DB). 1. To begin, right-click on a database and select "Set Query Tab Colors": ![]() 2. In the Database Tab Color dialog box, select a color that is indicative of the environment you have selected (e.g. Green for Dev, Blue for Validation and Red for Production): ![]() 3. Select the OK button and open a "New Query Window" for that database. You will see that the tab at the top of the screen has changed colors: ![]() ![]() Repeat this process for each of your databases. Tip: You can change the gradient (fade) color of the active tab to be more easily recognizable. Simply press Ctrl+Shift+s and find the option "SelectedTabGradient" and change it to a different color (Black is used in the screen shot below): ![]() 5. When done, the different tab colors enable you to quickly and easily differentiate between your open editor windows: ![]() AUTHOR Stephen Schmidt LAST REVIEW DATE 21 August 2007 Labels: Apex SQL Edit ...Welcome to the ApexSQL Knowledge Base Welcome to the ApexSQL Training Knowledge Base. Here you'll find tips, reviews, videos, and articles on how to get the most out of ApexSQL Tools and Microsoft SQL Server. Labels: Apex SQL Data Diff, Apex SQL Debug, Apex SQL Diff, Apex SQL Edit, Apex SQL Refactor, Apex SQL Script, Apex SQL SSIS Compare, ApexSQL Clean, ApexSQL Code, ApexSQL Doc ... |
© 2008 Apex SQL Tools All Rights Reserved | 1.919.968.8444 | Contact Us | Terms of Use | Privacy Policy
























































.

































