Moving from Access Databases to a Visual Studio/SQL Server Solutions Andrew Couch UK Access User Group asc associates www.upsizing.co.uk.

Slides:



Advertisements
Similar presentations
Oracle to MySQL Database Migration SQLWays - Migration Software Presentation Copyright (c) Ispirer Systems Ltd. All Rights Reserved.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizards Guide to PHP by David Lash.
Data Definition and Integrity Constraints
Designing Tables in Microsoft Access By Ed Lance.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Database Chapters.
WaveMaker Visual AJAX Studio 4.0 Training
1 Chapter 1 & 2 Relational Databases and Queries CS101 WVU.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Fall 2001Arthur Keller – CS 1808–1 Schedule Today Oct. 18 (TH) Schemas, Views. u Read Sections u Project Part 3 extended to Oct. 23 (T). Oct.
Final Review Sunday March 13th. Databases –Entities/Rows –Attributes/Columns –Keys –Relationships –Schema –Instance.
Data Modelling. EAR model This modelling language allows a very small vocabulary: Just as English has nouns, verbs, adjectives, pronouns.., EAR models.
DT211 Stage 2 Databases Lab 1. Get to know SQL Server SQL server has 2 parts: –A client, running on your machine, in the lab. You access the database.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Copyright © ASC Associates All Rights Reserved. MUST Pack And Go Migration Demonstration Upsizing an Access back-end and re-linking an Access front-end.
Copying, Managing, and Transforming Data With DTS.
Data Definition, Relational Manipulation and Data Control Using SQL.
Sql Server Advanced Features MIS 424 Professor Sandvig.
Oracle Data Definition Language (DDL)
SQL Basics. SQL SQL (Structured Query Language) is a special-purpose programming language designed from managing data in relational database management.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Database Design for DNN Developers Sebastian Leupold.
ASP.NET Programming with C# and SQL Server First Edition
Chapters 17 & 18 Physical Database Design Methodology.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 13 Database Design.
TM 7-1 Copyright © 1999 Addison Wesley Longman, Inc. Physical Database Design.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Using New Data Types in 2008 Andrew Couch UK Access User Group ASC associates
Oracle Database Administration
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Commercial RDBMSs Access and Oracle. Access DBMS Architchecture  Can be used as a standalone system on a single PC: -JET Engine -Microsoft Data Engine.
Advanced Web 2012 Lecture 3 Sean Costain What is a Database? Sean Costain 2012 A database is a structured way of dealing with structured information.
Visual Programing SQL Overview Section 1.
IMS 4212: Data Manipulation 1 Dr. Lawrence West, MIS Dept., University of Central Florida Additional Data Manipulation Statements INSERT.
Introduction to a Database Defining a database Database window in Access The six items in window: Tables, Queries Forms, Reports, Macros, Modules.
GLOBEX INFOTEK Copyright © 2013 Dr. Emelda Ntinglet-DavisSYSTEMS ANALYSIS AND DESIGN METHODSINTRODUCTORY SESSION EFFECTIVE DATABASE DESIGN for BEGINNERS.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
1 CS 430 Database Theory Winter 2005 Lecture 10: Introduction to SQL.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
1 CS 430 Database Theory Winter 2005 Lecture 11: SQL DDL.
Copyright © Andrew Couch 2007 All rights reserved. Access Tables Without Keys & Views How To Manage Keys On Access Tables Andrew Couch ASC Associates.
Class 3Intro to Databases Class 4 Simple Example of a Database We’re going to build a simple example of a database, which will allow us to register users.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
 What is DB Testing ?  Testing at the Data Access Layer  Need for Testing DB Objects  Common Problems that affect the Application  Should Testers.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
Lec-7. The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE.
1 Agenda TMA02 M876 Block 4. 2 Model of database development data requirements conceptual data model logical schema schema and database establishing requirements.
7 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
15 Copyright © Oracle Corporation, All rights reserved. Managing Users.
TABLES AND INDEXES Ashima Wadhwa.
Managing Tables, Data Integrity, Constraints by Adrienne Watt
Data Definition and Data Types
Physical Database Design
Database systems Lecture 3 – SQL + CRUD
Contents Preface I Introduction Lesson Objectives I-2
Data Definition Language
Chapter 2 Design Table and Form.
Chapter 2 Design Table and Form.
Presentation transcript:

Moving from Access Databases to a Visual Studio/SQL Server Solutions Andrew Couch UK Access User Group asc associates

Phases Migrating the database design and data to SQL Server, re- linking Access application to SQL Server Migrating queries to views and stored procedures, also re- packaging the SQL behind Forms and Reports to SQL Server if targeting to Visual Studio. Performance tuning or to make the next step. Migrating the application to use web forms and report services with Visual Studio

Migrating the Database Design and Data

Preparing the Database Design Access Design Tables & Fields Add missing defaults for Boolean fields Avoid zero-length string anomaly Add timestamps (recommended) Add auditing fields (nice opportunity to add at this point) Decide on specific data type mappings; memos to VARCHAR(MAX) or TEXT, OLE Objects to VARBINARY(MAX) or IMAGE and setting decimals precision Relationships Correct for cycles removing cascade operations from relationships (

Preparing the Database Design (2) Table validation rules (checks) Translate Access expressions and functions Field validation rules (checks) Translate Access expressions and functions Indexes Reject inefficiencies, 20% rule Check indexing on foreign key fields Check for primary keys, add if absent Map unique indexes that ignore nulls to unique index and trigger

Schemas and Synonyms

Architecture : Schemas/Security Schemas Group together design objects Partioning designs Combining Access databases Synonyms required for ease of reference Security Database roles Grant permission on schemas Assign users to roles User database roles schemas

Preparing Data Issues Missing data in a required field, fix data or make field allow nulls, no workaround beyond this Violation of other checks (validation rules), avoid by adding checks after data migrated, or fix the data, adding checks after migration gets around some of these issues Date range problem and invalid dates, fix the data, no work around Violation of R.I and deep seated corruption, difficult to generalise, migrate data, remove bad data then add relationships

Migration Sequence Initial Migration Migrate optimised and corrected structure Check and fix data Migrate data Add checks, triggers, indexing and relationships Commissioning Check and fix data Drop checks, triggers, indexing and relationships Empty data Migrate data Add checks, triggers, indexing and relationships

Skills : SQL Server a new world ? A more important system ? Dbas, support, security and reviews of changes to design Production and development environments More developers Better control Version Control Comparing Development and Production Script files to transfer change, GUI dangers in production environments!

Skills : SQL Server a new world ? (2) Other Issues Backups Server Tuning Security Access Application Could stop here and retain the Access front-end Tune SQL converting as required to SPs, Views and Pass Through Or we can go on and do further bulk conversions Do all your existing queries work? Do you need all your existing queries ?

Migrating queries and re-packaging the SQL behind Forms and Reports

Screen Control Example SELECT BigCustomers.Country, BigCustomers.* FROM BigCustomers WHERE (((BigCustomers.Country)=[Forms]![frmPrompt]![txtCountry]));

Parameter Table & View CREATE TABLE tblParameters( SelectedCountry VARCHAR(15), SelectedDate DATETIME, SelectedRegion VARCHAR(15), UserName VARCHAR(128) DEFAULT suser_name() ) CREATE VIEW vw_tblParameters AS SELECT * FROM tblParameters WHERE UserName = suser_name()

Translated View CREATE VIEW vw_ResultsSimple AS SELECT * FROM BigCustomers CROSS JOIN vw_tblParameters WHERE [Country] = [SelectedCountry] SELECT BigCustomers.Country, BigCustomers.* FROM BigCustomers WHERE (((BigCustomers.Country)=[Forms]![frmPrompt]![txtCountry]));

Another Example; optional start SELECT IIf(Not IsNull([Forms]![frmPrompt]![txtTheDate]), IIf([Forms]![frmPrompt]![txtTheDate]<[Date],1,0),1) AS Expr1, IIf(Not IsNull([Forms]![frmPrompt]![txtCountry]), IIf([Forms]![frmPrompt]![txtCountry]=[Country],1,0),1) AS Expr2, BigCustomers.* FROM BigCustomers WHERE (((IIf(Not IsNull([Forms]![frmPrompt]![txtTheDate]), IIf([Forms]![frmPrompt]![txtTheDate]<[Date],1,0),1))=1) AND ((IIf(Not IsNull([Forms]![frmPrompt]![txtCountry]), IIf([Forms]![frmPrompt]![txtCountry]=[Country],1,0),1))=1));

Making Parameters Optional CREATE VIEW vw_Results AS SELECT * FROM BigCustomers CROSS JOIN vw_tblParameters WHERE COALESCE ([Country], ' ') = COALESCE ([SelectedCountry], [Country], ' ') AND COALESCE ([Date], ' 1/1/1900') >= COALESCE ([SelectedDate], [Date], '1/1/1900')

Translating SQL We choose here to consider maximising translation of objects to SQL Server objects, rather than embedding SQL in code Stored Procedures Views Access Support Library Custom UDF Translation Parameter Translation Form/Report Control and Record Source re-packaging SQL

INSERT, UPDATE, DELETE Stored Procedure (need to use pass-through queries to call these by name) Pass-Through Query; containing explicit SQL SELECT, CROSSTAB View (need to indicate unique fields to make these updateable, where possible, can be linked just like tables) Stored Procedure (read-only, can not be linked need to use pass-through queries to call these) Pass-Through Query (read-only); containing explicit SQL What Queries Translate To

References Nested Queries (Calculations) Work out how many layers are going to be required, and then decide whether it would be better to generate a results table using selection criteria, upon which to base the calculations or work with the Nested Query. Parameters Table (Parameters) Isolate all the screen references and parameter statements and use a table containing parameters to filter the SQL, Conversion of IIF statements to CASE statements and use of COALESCE functions for optional parameters.

Migrating the Application

Access Application Objects Menus, Toolbars and Navigation Forms Reports Macros, Modules and Form/Report Module Code

Architecture : Web Forms a Strategy Simple bound controls and templates Web site menu Master Pages and style sheets Further points to consider Screen layouts and screen areas Searching and filtering data

Example Converted Form

Sitemap

Master pages and Content Areas

CSS to Control Presentation

Searching and Filtering

Application Issues We are only considering the use of bound controls with custom templates here Inconsistent data in fields invalid drop-down box selections invalid radio button selections Error handling error handling is a necessity

Application Issues (2) Grid control when inserting data Searching and filtering for data Locking problems No support for timestamps on bound controls Security strategies Internet Integrated security ASP. net security

Report Services Easy security with groups Forms to prompt Launching using ReportViewer controls Import Access reports into a Visual Studio Report Server project

Report Server

Skills : Lost Count Now? New technology areas SQL Server Visual Studio web forms and.net Report Server IIS Challenges for newcomers Security And security

MUST Download a trial version from Site contains a number of technical articles, expanding on these topics