Session 2 Access to SQL Server 2000 Adam Cogan Database Architect ssw.com.au.

Slides:



Advertisements
Similar presentations
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 9-1 COS 346 Day 20.
Advertisements

Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Ten: Managing Databases with SQL Server 2008.
A Comparison of Database Software CS 616 April 8, 2004 Team 7 Mandar Patankar Jonathan Cohen B. Timothy Walsh.
Module 9: Implementing Stored Procedures. Introduction to Stored Procedures Creating Executing Modifying Dropping Using Parameters in Stored Procedures.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Concepts of Database Management Sixth Edition
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
1 Chapter Overview Transferring and Transforming Data Introducing Microsoft Data Transformation Services (DTS) Transferring and Transforming Data with.
Chapter 9: Creating Database Conventions & Standards MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
Overview What is SQL Server? Creating databases Administration Security Backup.
Module 1: Introduction to Microsoft SQL Server 7.0.
Session 3 Access to Reporting Services Adam Cogan Database Architect ssw.com.au.
Extreme Programming Adam Cogan Database Architect ssw.com.au.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
Overview of SQL Server Alka Arora.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
Building The Database Chapter 2
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
ApexSQL Log Recover accidentally truncated, dropped or deleted data with or without transaction log or its backup. Recover data from un-attachable/corrupted.
Introduction to Databases Chapter 8: Improving Data Access.
Database Design for DNN Developers Sebastian Leupold.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
ASP.NET Programming with C# and SQL Server First Edition
IMS 4212: Application Architecture and Intro to Stored Procedures 1 Dr. Lawrence West, Management Dept., University of Central Florida
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Database Technical Session By: Prof. Adarsh Patel.
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
© Paradigm Publishing Inc. 9-1 Chapter 9 Database and Information Management.
Stored Procedures, Transactions, and Error-Handling
T-SQL Transact-SQL is microsoft implementation of SQL. It contains additional programming constracts T-SQL enables you to write programs that contain SQL.
Converting Access 97 to 2003 Adam Cogan Database Architect ssw.com.au.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 9 – Building Links,
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Storing Organizational Information - Databases
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Rules to Healthier Code Presented by Adam Cogan (Chief Architect for
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
CHAPTER 3 DATABASES AND DATA WAREHOUSES. 2 OPENING CASE STUDY Chrysler Spins a Competitive Advantage with Supply Chain Management Software Chapter 2 –
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
06 | Modifying Data in SQL Server Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
Access Chapter 1: Intro to Access Objectives Navigate among objects in Access database Difference between working in storage and memory Good database file.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Session 1 Module 1: Introduction to Data Integrity
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
IMS 4212: Application Architecture and Intro to Stored Procedures 1 Dr. Lawrence West, Management Dept., University of Central Florida
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
DAY 14: ACCESS CHAPTER 1 RAHUL KAVI October 8,
Creating Simple and Parallel Data Loads With DTS.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
SQL Triggers, Functions & Stored Procedures Programming Operations.
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL Server 2000 and Access 2000 limits
Module 5: Implementing Data Integrity by Using Constraints
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Session 2 Access to SQL Server 2000 Adam Cogan Database Architect ssw.com.au

About Adam Chief Architect for - experience with: –internal corporate development and –generic off-the-shelf databases –Clients: Enterasys Networks, Cisco, Microsoft… Run Teams of Developers President.NET User Group, Sydney Speaker for Microsoft Roadshows, Dev Conn, VSLive Microsoft Regional Director, Australia

To From

Overview Access 97 to Access 2003 Accessto SQL Server AccesstoReportingServicesAccesstoWindows Forms.NET 1234

Agenda Current Problems What’s New and Different in SQL Server –Architecture –Scalability & Performance –Working with Data Lab: Migrating from Access to SQL Server

Assumptions Data is currently in MDB (Access 2000/2002/2003) SQL Server 2000 installed Familiar with VBA / DAO Familiar with Access features –Indexes –Relationships –Referential integrity –etc.

Session Prerequisites (Current Problems) 1. 1.“We keep getting corrupt data” 2. 2.“We need to handle more database users” 3. 3.“I don’t want the system to go down when we are doing backups” 4. 4.“Is our database secure? I’m worried people could copy the MDB and take it home” 5. 5.“The database crashed and we are missing some records”

Enter SQL Server… Transaction-based (1,5) Can split database across multiple processors and hard drives (2) Number of concurrent users limited only by system memory (2) Live backups (3) Jobs for automated backups (3) No file access required to read data (4)

SQL Server Tools New Tool Set SQL Server Enterprise Manager SQL Server Query Analyzer Visual Studio.NET Data Transformation Services (DTS) SQL Server Profiler

Differences in Architecture Advantage – Less Chance of Data Corruption In Access Database is opened directly Unexpected system shutdown can corrupt data

Differences in Architecture Advantage – Less Chance of Data Corruption SQL Server Runs as a service Requests are managed separately Transactions not processed in case of system failure Integrity is maintained

Differences in Architecture Advantage – Database Log Files Enable Data Recovery In Access No logging of transactions SQL Server All database transactions can be logged Can be used to recover data in case of system failure

Differences in Architecture Difference – Higher Minimum System Requirements In Access Pentium 75 MHz 128MB 30 MB space Windows 98

Differences in Architecture Difference – Higher Minimum System Requirements In SQL Server Pentium 166MHz 128MB RAM 270 MB space Windows 9x

Differences in Architecture Difference – Higher System Requirements In SQL Server – Realistically you need Pentium III 650MHz 512MB RAM 2 GB space Windows 2003

Differences in Architecture Difference – Data Types All Access data types are handled but converted to equivalent SQL Server types Access (Jet)SQL Server Textnvarchar Memotext Numberint Date/Timedatetime CurrencyMoney AutoNumberint (with identity) Yes/Nobit OLE Objectimage Hyperlinktext

Differences in Architecture New User-Defined Data Types (UDDTs) In Access No way to ensure consistency in field lengths No way to quickly change data types or field lengths for multiple fields

Differences in Architecture New User-Defined Data Types (UDDTs) In SQL Server Specify a custom data type (e.g. ) Use in place of varchar(15) etc. Ensures field data type consistency

Differences in Architecture Difference – Identity Values Are Generated After an Insert In Access AutoNumber generated as you start editing a record In SQL Server Identity (AutoNumber) is only generated when record is saved Can affect functions which examine this value

Differences in Architecture Similarity – Table Design

Differences in Architecture Similarity – Relationships Created via Enterprise Manager

Differences in Architecture Difference – Data Validation In Access 1.Input Mask 2.Validation Rule 3.Validation Text 4.Indexed

Differences in Architecture Difference – Data Validation In SQL Server 1.NOT NULL – column cannot contain nulls 2.CHECK – restrict range of values in column 3.UNIQUE – ensures unique values (such as ID columns) 4.PRIMARY KEY 5.FOREIGN KEY

Differences in Architecture Difference – Data Validation In SQL Server Can specify CASCADE for a delete or update operation Cannot cascade update/delete from a table to itself Cannot relate fields with different lengths

Differences in Architecture Disadvantage – Cascading Update Circular References are Not Supported

Differences in Architecture Disadvantage – Cascading Update Circular References are Not Supported Unable to create relationship 'FK_EmployeeType_Employee'. ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Introducing FOREIGN KEY constraint 'FK_EmployeeType_Employee' on table 'EmployeeType' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. [Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint. See previous errors.

Differences in Architecture Improvements to Indexing (1 of 2) Clustered Indexes for fast searches

Differences in Architecture Improvements to Indexing (2 of 2) Clustered Indexes for fast searches

Differences in Architecture Similarity – Access Queries / SQL Views (1 of 2) Access Queries

Differences in Architecture Similarity – Access Queries / SQL Views (2 of 2) SQL Server Views

Differences in Architecture Similarity – Access Queries / SQL Stored Procedures (1 of 3) Access queries –Accept parameters –Sorted (ORDER BY) –Nesting –Updateability

Differences in Architecture Similarity – Access Queries / SQL Stored Procedures (2 of 3) Extensions to SQL-92 –Conditional logic (if…then…else) –More flexible sub-queries –Stored procedures

Differences in Architecture Similarity – Access Queries / SQL Stored Procedures (3 of 3) SQL Server stored procedures –Run in a compiled state –Execution plan –Perform conditional logic and return values CREATE PROCEDURE bit AS IF = 1) --True - only US customers SELECT * FROM Customers WHERE Country = 'USA' ELSE SELECT * FROM Customers WHERE Country <> 'USA' GO

Differences In Working With Data New – Temporary Tables Destroyed at end of current session Usage is same as tables Two types –Local – visible in current session Prefix with hash: #WestCoastCustomers –Global – visible to all sessions Prefix with double hash: ##WestCoastCustomers

Differences In Working With Data New – Table Variables Query a temporary set of joined data Stored in memory like other variables Very fast Use instead of local temp tables – faster

Differences in Architecture New Feature – Access Queries / SQL User- Defined Functions Replaces VBA Functions 3 Types of UDFs 1.Scalar UDFs 2.Inline UDFs 3.Multistatement UDFs

Differences in Architecture New Feature – Access Queries / SQL User-Defined Functions Scalar UDFs return a single value CREATE FUNCTION [dbo].[CalculateTax] money, -- The value to have tax varchar(255)) -- The current country RETURNS money -- The tax-inclusive price will be returned AS BEGIN money = 'Australia' -- If the country is Australia, add GST * 1.1 ELSE BEGIN -- Otherwise just return the original value END END

Differences in Architecture New Feature – Access Queries / SQL User-Defined Functions Inline UDFs return a table from a SELECT statement Use in place of views when you need parameters (can’t update) CREATE FUNCTION CustomerNamesInRegion nvarchar(30)) RETURNS table -- This function returns a table AS RETURN (SELECT CustomerID, CompanyName FROM Customers WHERE Region GO

Differences in Architecture New Feature – Access Queries / SQL User-Defined Functions Multistatement UDFs also return a table Can also return a filtered or joined set of data Much faster than temporary tables – stored in memory CREATE FUNCTION LargeOrderShippers money ) TABLE ( ShipperID int, ShipperName nvarchar(80), OrderID int, ShippedDate datetime, Freight money ) AS BEGIN SELECT S.ShipperID, S.CompanyName, O.OrderID, O.ShippedDate, O.Freight FROM Shippers AS S INNER JOIN Orders AS O ON S.ShipperID = O.ShipVia WHERE O.Freight RETURN END

Differences in Architecture New – Triggers on Tables and Views Fire when a change is made to data

Differences in Scalability & Performance More Users, Larger Database In Access Limited to ~20 concurrent users 2GB plus linked tables – can slow performance In SQL Server Users limited only by available memory Over 1 Million TB of storage Self-repairing and self-compacting

Differences in Scalability & Performance Differences in Querying Data (inc T-SQL) Change RecordSource: SELECT * FROM Customers To: SELECT * FROM Customers WHERE CustomerID = ‘BOLID’

Differences In Working With Data Advantage – Ability to Script Objects Automatically generate scripts Recreate your database anywhere Generate in order of dependency

Differences In Working With Data Advantage – Recovering from System Failure In Access Attempt to recover data using compact & repair then re-import Restore from recent backup (lost records) Run Jet Compact utility (JETCOMP.EXE) Send database to data recovery consultants All these ways are costly and risky…

Differences In Working With Data Advantage – Recovering from System Failure In SQL Server 3 recovery models –Simple –Full –Bulk-logged Complete control over transaction logging

Differences In Working With Data Advantage – Backups Can Be Done While the Database is Running In Access you have to log off all users first SQL Server allows live and automated backups using schedules

Other Issues Windows XP Service Pack 2 –Remote TCP Connections – Add to Trusted Zone –Only an issue with incoming connections, not outgoing

Summary Current Problems –Too Many Database Users –Corruption –Security –Backup and Recovery What’s New in SQL Server Other Issues Lab: Migrating from Access to SQL Server

For More Information… Lumigent LogExplorer

2 things