CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data...

45
CC SQL Utilities CC SQL Utilities

Transcript of CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data...

Page 1: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

CC SQL UtilitiesCC SQL Utilities

Page 2: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

CC SQL Utilities OverviewCC SQL Utilities Overview

The Primary tech tool used for viewing and The Primary tech tool used for viewing and changing data directly in the databasechanging data directly in the database

Backup and restoreBackup and restore Import and exportingImport and exporting SQL Query editorSQL Query editor Attaching and detaching databasesAttaching and detaching databases Other tech tools Other tech tools

Page 3: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

CC SQL Utilities LogonCC SQL Utilities Logon

Choose SQL sever Choose SQL sever computer name\comcashcomputer name\comcash

Enter username and passwordEnter username and password sa - no passwordsa - no password

Page 4: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Utilities LaunchesUtilities Launches

Initially the server name appearsInitially the server name appears Run SQL Server Service ManagerRun SQL Server Service Manager Check Program VersionsCheck Program Versions Attach DatabaseAttach Database

Prompts for .mdf filePrompts for .mdf file

Check for CC SQL Utilities updateCheck for CC SQL Utilities update Needs internet connectionNeeds internet connection

Expand the serverExpand the server The attached databases are displayedThe attached databases are displayed

Page 5: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.
Page 6: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Select a databaseSelect a database

The database properties are displayedThe database properties are displayed SizeSize Date createdDate created File locationFile location Name of .mdf fileName of .mdf file Name of .ldf fileName of .ldf file

Page 7: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Go Live Go Live

Clears out any unwanted data entered while Clears out any unwanted data entered while evaluating ComCashevaluating ComCash

Select to keep some data (optional)Select to keep some data (optional) CustomersCustomers CashiersCashiers RegistersRegisters ProductsProducts Quick Service MenuQuick Service Menu VendorsVendors ConsignorsConsignors Prompts to backup existing dataPrompts to backup existing data

Page 8: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Empty one or more tablesEmpty one or more tables

Very powerfulVery powerful Always BACKUP data firstAlways BACKUP data first

Page 9: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Display row count for all Display row count for all tables in the databasetables in the database

Helpful tool to display the number of rows Helpful tool to display the number of rows in all tablesin all tables

Click on “Number of Rows” column Click on “Number of Rows” column header to list table in order of row count. header to list table in order of row count.

Page 10: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Detach DatabaseDetach Database

Cannot detach until all connections are Cannot detach until all connections are cleared firstcleared first

Page 11: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Change Location Change Location

Changes the location number the data is Changes the location number the data is associated withassociated with

Page 12: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Delete LocationDelete Location

Deletes all records associated with a Deletes all records associated with a specified location numberspecified location number

Page 13: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Set modified flags in one Set modified flags in one or more tablesor more tables

Marks records as “modified” for specified Marks records as “modified” for specified tables (forces records to poll)tables (forces records to poll)

Prompts for location number Prompts for location number

Page 14: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Clear modified flags in Clear modified flags in one or more tablesone or more tables

Clears the “modified” property of records Clears the “modified” property of records for tables specified. (records will not poll)for tables specified. (records will not poll)

Page 15: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

SQL Query Interface SQL Query Interface UtilityUtility

Warns user – this is a very powerful utilityWarns user – this is a very powerful utility Can write and run SQL statementsCan write and run SQL statements

SelectSelect UpdateUpdate DeleteDelete InsertInsert

Results are returned in a powerful grid Results are returned in a powerful grid formatformat

Page 16: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Grids in CC SQL UtilitiesGrids in CC SQL Utilities

Click column headers to:Click column headers to: Sort data by any fieldSort data by any field

Drag the column header upDrag the column header up to group bar to Group data by any fieldto group bar to Group data by any field

Filter Data by:Filter Data by: All – no filterAll – no filter Selection – choose an available value from a fieldSelection – choose an available value from a field Custom – use logic to build custom filters (can be Custom – use logic to build custom filters (can be

saved and recalled)saved and recalled)

Page 17: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Custom FiltersCustom Filters

Equals \ does not equalEquals \ does not equal Is less than \ is less than or equal toIs less than \ is less than or equal to Is greater than \ is greater than or equal toIs greater than \ is greater than or equal to Is like \ is not likeIs like \ is not like

Use _ to represent any single characterUse _ to represent any single character Use % to represent any series of charactersUse % to represent any series of characters

Is blank \ is not blankIs blank \ is not blank Use And\or operators to create compound Use And\or operators to create compound

filtersfilters

Page 18: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Print Grids as a reportPrint Grids as a report

Use the report designer feature to Use the report designer feature to customize the reportcustomize the report

Page 19: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Backup Manager Backup Manager OverviewOverview

Creates a .bak file manually or automaticallyCreates a .bak file manually or automaticallyWhen restored, it replaces existing data (does When restored, it replaces existing data (does not add to it)not add to it)

Backs up, literally, all the dataBacks up, literally, all the data Can be moved to another computer and Can be moved to another computer and

restoredrestored All prior backups are listed in the back up All prior backups are listed in the back up

registry making them easy to find and restore.registry making them easy to find and restore. Marked with date\time stampMarked with date\time stamp

Page 20: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Automatic BackupsAutomatic Backups

Turn on automatic backup feature in ComCash Manager Turn on automatic backup feature in ComCash Manager RegistersRegisters

Entire database is backed up daily with close of dayEntire database is backed up daily with close of day Backups are named for the day of the week (Monday, Tuesday, Backups are named for the day of the week (Monday, Tuesday,

Wednesday, etc.) Wednesday, etc.) This Monday’s backup will overwrite last Monday’s backupThis Monday’s backup will overwrite last Monday’s backup .bak stored in C:\Program Files\ComCash\CCDatabases\Backups.bak stored in C:\Program Files\ComCash\CCDatabases\Backups Offload c:\Program Files\ComCash 8.0\CCDatabase\backups Offload c:\Program Files\ComCash 8.0\CCDatabase\backups

folder once a week for a 365 day accounting of the datafolder once a week for a 365 day accounting of the data Restore the “auto-backups” just like any other backupRestore the “auto-backups” just like any other backup

Page 21: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Manual BackupsManual Backups

Create a new backupCreate a new backup Prompts user for a directoryPrompts user for a directory Appears in the registryAppears in the registry Restore selected backupRestore selected backup Overwrite selected backupOverwrite selected backup Delete selected backupDelete selected backup Register a backup from another serverRegister a backup from another server

.bak file backed up from another server.bak file backed up from another serveronly registered backups can be restoredonly registered backups can be restored

Page 22: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Expand the database and Expand the database and select a tableselect a table

Initially the first 200 rows are displayed Initially the first 200 rows are displayed One does not want to inadvertently display One does not want to inadvertently display

all rows in a 500,000 line item tableall rows in a 500,000 line item table Displayed in powerful gridDisplayed in powerful grid

Page 23: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Read\Write Mode (toggle)Read\Write Mode (toggle)

Read modeRead mode Data can only be viewedData can only be viewed

Read\write modeRead\write mode Allows user to edit, append and delete data Allows user to edit, append and delete data

directly on griddirectly on grid

Page 24: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

SP Helper StingsSP Helper Stings

Used by programmers and very Used by programmers and very advanced users to aid writing stored advanced users to aid writing stored procedures and queriesprocedures and queries

Page 25: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Clear tableClear table

Empties the selected tableEmpties the selected table

Page 26: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Export DataExport Data

Page 27: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Exporting Data OverviewExporting Data Overview

Data from any selected table can be exportedData from any selected table can be exportedAll fields or only specified fields can be exportedAll fields or only specified fields can be exported

All rows or only rows meeting specified criteria can be All rows or only rows meeting specified criteria can be exportedexported

Exported files includes field names for column headersExported files includes field names for column headers Data is exported to a .csv file (comma separated)Data is exported to a .csv file (comma separated) .csv is the most common file type for exported files.csv is the most common file type for exported files Can be imported into Microsoft Excel (and many other Can be imported into Microsoft Excel (and many other

programs).programs).Export wizard startsExport wizard starts

Page 28: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Step 1 – Enter File NameStep 1 – Enter File Name

Prompts for file name/directoryPrompts for file name/directoryUser can browse to the directoryUser can browse to the directory

Page 29: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Step 2 – Create / Load Step 2 – Create / Load Data MapData Map

Select fields to export (all or only Select fields to export (all or only selected)selected)

Choose the order of fields to exportChoose the order of fields to export Save, Load, Rename, and Delete created Save, Load, Rename, and Delete created

data mapsdata maps

Page 30: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Step 3 – Export the dataStep 3 – Export the data

Offers user the option of entering a SQL Offers user the option of entering a SQL ‘where’ clause to limit the exported data ‘where’ clause to limit the exported data by specified criteria (i.e. where dept = 4)by specified criteria (i.e. where dept = 4)

Click StartClick Start Progress bar is displayedProgress bar is displayed Number of rows exported is displayedNumber of rows exported is displayed

Page 31: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import DataImport Data

Page 32: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Data OverviewImport Data Overview

Uses a mapping method to import data Uses a mapping method to import data from a .csv file into the selected tablefrom a .csv file into the selected table

Errors will be reported at the end of the Errors will be reported at the end of the import process and any rows not import process and any rows not imported can be saved in a separate file imported can be saved in a separate file so that they may be reviewed and so that they may be reviewed and corrected.corrected.

Page 33: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Step 1 – Pick your CSV Step 1 – Pick your CSV FileFile

Type in the name and path for (or browse to) your .csv fileType in the name and path for (or browse to) your .csv file Select the delimiter (tab or comma)Select the delimiter (tab or comma) Check box: The first line of the CSV file contains field namesCheck box: The first line of the CSV file contains field names Check the box if you have prepared your file by titling each Check the box if you have prepared your file by titling each

column with the field name the data is destined forcolumn with the field name the data is destined for Check the box if the file was exported using CC SQL UtilitiesCheck the box if the file was exported using CC SQL Utilities Check box: Auto generate import rules based on CSV column Check box: Auto generate import rules based on CSV column

namesnames Check the box if you checked the previous box and want the Check the box if you checked the previous box and want the

program to “auto-generate” rules for the import process to import program to “auto-generate” rules for the import process to import data into fields where the field name matches the column headerdata into fields where the field name matches the column header

Page 34: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Step 2 – Create / Load a Step 2 – Create / Load a MapMap

The table structure is displayedThe table structure is displayed Field nameField name Data typeData type LengthLength Required?Required? Delete, rename, load, and save created MapsDelete, rename, load, and save created Maps Create rules for all fields that are to receive data Create rules for all fields that are to receive data

during the import. (You must create rules for during the import. (You must create rules for “required” fields)“required” fields)

Page 35: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Import from a CSV columnImport from a CSV column Enter the column number from the CSV fileEnter the column number from the CSV file

Page 36: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Insert a fixed text valueInsert a fixed text value Enter the text valueEnter the text value Program will populate field with the same Program will populate field with the same

value for all rows importedvalue for all rows imported Example: you can use this feature to Example: you can use this feature to

populate Size with “Large” for all rows populate Size with “Large” for all rows imported.imported.

Page 37: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Enter a fixed integer value (whole Enter a fixed integer value (whole number)number) Enter the integer valueEnter the integer value Program will populate a field with the same Program will populate a field with the same

value for all rows importedvalue for all rows imported Example: you can use this feature to Example: you can use this feature to

populate the location_no field with 1 for all populate the location_no field with 1 for all rows importedrows imported

Page 38: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Enter a fixed floating point value (number Enter a fixed floating point value (number with a decimal in it)with a decimal in it) Enter the floating point valueEnter the floating point value Program will populate field with the same Program will populate field with the same

value for all rows importedvalue for all rows imported Example: you could use this feature to set Example: you could use this feature to set

the price 1.99 for all rows importedthe price 1.99 for all rows imported

Page 39: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Insert an incrementing integer value from Insert an incrementing integer value from a fixed starting valuea fixed starting value Enter the starting valueEnter the starting value Enter the incrementing valueEnter the incrementing value Example: if you re importing products, you Example: if you re importing products, you

can use this option to generate PLUs can use this option to generate PLUs starting from 400000001starting from 400000001

Page 40: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Insert an incrementing value starting from Insert an incrementing value starting from the columns current max valuethe columns current max value Enter the increment valueEnter the increment value Example: if you are importing customers, Example: if you are importing customers,

you can use this feature to generate you can use this feature to generate incrementing customer numbers for all rows incrementing customer numbers for all rows imported starting with the highest customer imported starting with the highest customer number already in you customer table.number already in you customer table.

Page 41: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Import Map RulesImport Map Rules

Bit valueBit value Inserts a fixed bit value for all rows importedInserts a fixed bit value for all rows imported Example: you can use the set the modified Example: you can use the set the modified

field to true (1) for all rows importedfield to true (1) for all rows imported

Page 42: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Ready to importReady to import

Click StartClick Start Progress bar is displayedProgress bar is displayed Error log is created and user is given the Error log is created and user is given the

option to save itoption to save it This is where the bad_CSV_rows This is where the bad_CSV_rows

information will goinformation will go

Page 43: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

Set ModifiedSet Modified

Marks records as “modified” for the Marks records as “modified” for the selected table (forces records to poll)selected table (forces records to poll) Prompts for location number Prompts for location number

Clear Modified flagsClear Modified flags Un-marks records as “modified” for the Un-marks records as “modified” for the

selected table (records will not poll)selected table (records will not poll) Prompts for location number Prompts for location number

Page 44: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

View Table StructureView Table Structure

Field namesField names Field typesField types

i.e. char, int, biti.e. char, int, bit

LengthLength RequiredRequired Nulls allowed / not allowedNulls allowed / not allowed

Page 45: CC SQL Utilities. CC SQL Utilities Overview The Primary tech tool used for viewing and changing data directly in the database The Primary tech tool used.

View Table ContentsView Table Contents

Shows table contents again when Shows table contents again when viewing table structureviewing table structure