You are on page 1of 4

Stacia Harmon Student ID: 4022366 Assignment 8 Info 361 1.

Transferring data from and to MS SQL Open SQL Server Integration Services (SSIS) designer and create a new package or select an existing one to use. Locate the "Transfer Data Task" in the toolbar on the left and drag it to the right side of the screen. Type a name for the database task and a description, if desired, in the General properties window. Switch to the Databases page of the task editor box. Enter the source database and destination database information, creating new connections to the servers if needed. Enter the destination database information, including the desired name, file names and file location. If the destination database already exists, select overwrite options. Select the desired action and method. The action is either copy or move. The method is either online mode or offline mode. Enter the source database information, including the name and file names. Choose what you want done in case of failure. You can either set the task to reattach the source database or leave it offline in the event of a failure. Apply the changes and click "OK." Execute the package to transfer the database. 2. Transferring data from/to another source such as Oracle,Excel, text and XML The simplest way that you can use DTS is using a Wizard. You can access a DTS Wizard in Enterprise Manager by right-clicking an object such as a table or database, selecting All Tasks, and then selecting Import/Export Data from the menu that appears. This starts the Data Transformation Wizard, which guides you through transferring data into and out of SQL Server, step by step. The first step of the DTS Wizard prompts you to select a source of the data. You can select SQL Server as the source, which usually means that you're going to export data. You can also select another source, such as text files, Microsoft Excel worksheets, Oracle databases, etc., which could indicate that you're importing data. Next you select the objects within that first choice, which depends on the source of the data. You can import or export tables, views even the results of stored procedures. The next step is to select the destination of the data. Just like the selections presented for the source section, this choice can consist of many different types of data storage. This choice of both source and destination types is one of the main strengths of DTS you can use it not only for SQL Server, but also between other data engines. For instance, you can export data from an Oracle database to a Microsoft Access database file, or from a text file into a FoxPro database file.

The next choice the wizard presents is to transform the data. This exposes another powerful feature in DTS: the ability to modify the data as it is being transferred. These transforms can even be coded, such that every third letter could be changed to the number five, and so forth. Once you're done making all these selections, the wizard allows you to save the settings to a file, a database, or even a special type of database called a repository. Saving these settings brings us to the next type of DTS use, which is really just accessing all the settings I've been talking about directly something Microsoft calls a DTS package. Many DBAs create their initial package from a wizard and then edit it to fit a broader purpose.

3. Backup and restore USE master; --Make sure the database is using the simple recovery model. ALTER DATABASE Northwind SET RECOVERY SIMPLE; GO -- Back up the full Northwind database. BACKUP DATABASE Northwind TO DISK = 'Z:\SQLServerBackups\AdventureWorks.bak' WITH FORMAT; GO --Create a differential database backup. BACKUP DATABASE Northwind TO DISK = 'Z:\SQLServerBackups\AdventureWorks.bak' WITH DIFFERENTIAL; GO --Restore the full database backup (from backup set 1). RESTORE DATABASE Northwind FROM DISK = 'Z:\SQLServerBackups\AdventureWorks.bak' WITH FILE=1, NORECOVERY; --Restore the differential backup (from backup set 2). RESTORE DATABASE Northwind FROM DISK = 'Z:\SQLServerBackups\AdventureWorks.bak' WITH FILE=2, RECOVERY; GO To restore a full database backup The basic RESTORE syntax for restoring a database backup is: RESTORE DATABASE database_name FROM backup_device [ WITH NORECOVERY ] 4. Using Ms Access upsizing wizard

There are three ways to use the Upsizing Wizard: Upsize all database objects from an Access database to an Access project so that you can create a client/server application. This approach requires some additional application changes and modification to code and complex queries. Upsize only data or data definitions from an Access database to a SQL Server database. Create an Access database front-end to a SQL Server database back-end so that you can create a frontend/back-end application This approach requires very little application modification since the code is still using the Access database engine (ACE) 5. When and how to use the tools such as Bulk Insert, bcp, Copy Data Base Wizard

Importing data is the process of retrieving data from sources external to Microsoft SQL Server, for example, an ASCII text file, and inserting the data into SQL Server tables. Exporting data is the process of extracting data from SQL Server into some user-specified format, for example, copying the contents of a SQL Server table to a Microsoft Access database. Importing data from an external data source into SQL Server is likely to be the first step you perform after setting up your database. After data has been imported into your SQL Server database, you can start to work with the database. Importing data into SQL Server can be a one-time occurrence; for example, when migrating data from one database system to a SQL Server database because SQL Server is replacing the previous system. After the initial migration is complete, the SQL Server database is used directly for all data-related tasks, rather than the original system. No further data imports may be required. Importing data can also be an ongoing task. For example, a new SQL Server database is created for executive reporting purposes, but the data resides in legacy systems updated from a large number of business applications. In this case, a daily or weekly import process can be created to copy new or updated data from the legacy system to SQL Server. Exporting data is usually a less frequent occurrence. SQL Server provides a variety of tools and features that allow applications, such as Access or Microsoft Excel, to connect and manipulate data directly, rather than having to copy all the data from SQL Server to the tool before manipulating. Data may need to be exported from SQL Server regularly if, for example, SQL Server needs to feed data to another business application. In this case, the data can be exported from SQL Server to a text file, and then read from the text file by the application. Alternatively, data can be copied on an ad hoc basis if, for example, a user wanted to extract data from SQL Server into a Excel spreadsheet running on a portable computer, and take the computer on a business trip. SQL Server provides tools for importing and exporting data to and from a variety of data sources including text files, ODBC data sources (such as Oracle databases), OLE DB data sources (such as other servers running SQL Server), ASCII text files, and Excel spreadsheets. Additionally, SQL Server replication allows data to be distributed across an enterprise, copying data between locations and synchronizing changes automatically between different copies of data. Choosing the tool to use for Import or Export data Data can be imported and exported from Microsoft SQL Server using several tools and Transact-SQL statements. You can also write your own programs to import and export data using the programming models and application programming interfaces (APIs) available with SQL Server. Methods for copying data to and from SQL Server include: Using the Data Transformation Services (DTS) Import and Export wizards or DTS Designer to create a DTS package that can be used to import or export data. The DTS package can also transform data during the import or export process. Using SQL Server replication to distribute data across an enterprise.

The replication technology in SQL Server allows you to make duplicate copies of your data, move those copies to different locations, and synchronize the data automatically so that all copies have the same data values. Replication can be implemented between databases on the same server or different servers connected by LANs, WANs, or the Internet. For more information, see "Replication" in Microsoft SQL Server Distributed Data Operations and Replication. Using the bcp command prompt utility to import and export data between SQL Server and a data file. Using the BULK INSERT statement to import data from a data file to SQL Server. Using the SELECT INTO statement to create a new table based on an existing table. It is possible to select data from an arbitrary OLE DB provider, allowing data to be copied from external data sources into SQL Server. Using the INSERT statement to add data to an existing table. A distributed query that selects data from another data source can also be used to specify the data to be inserted. The method chosen to import or export data depends on a variety of user requirements, the most common being: The format of the source and destination data. The location of the source and destination data. Whether the import or export is a one-time occurrence or an ongoing task. Whether a command prompt utility, Transact-SQL statement, or graphical interface is preferred (ease-ofuse). The performance of the import or export operation. 6- Your recommendations for tools and procedures Since I currently do not do much of the backup and restore of our databases, I cannot recommend any tools or procedures. This would take many months -- years of performing the process before I could make a professional recommendation.