Migrate a forum that uses access to SQL Server

Source: Internet
Author: User
Tags current time access database
An internal forum was created using the Forum program provided by the dynamic network. Originally, this forum is posted on the IIS5 of Windows2000. His database is in Access. However, when I moved this forum to windows2003, I found that I often died. Went online and consulted with Microsoft's engineers, and many people thought I had something to do with access. Also, I would like to add a marquee on the home page of the company to show the new posts in the forum, but if you continue to use access, it is not so convenient to visit. So I decided to migrate to SQL.
First step: Import data into SQL Server
Go to SQL Server Enterprise Manager, create a new database, and then select Import data, select an Access database as the import source, and import all the data.
Step Two: Modify the data table
The data tables that are created in this way do not have primary keys and defaults, and modify each table to refer to the original Access library. (This is annoying, but must be done, because these defaults will be used in subsequent programs)
Step Three: Modify the program

Migrate the site to the appropriate server and create a new site. The first thing to change is the database connection. Because some functions in access are not the same as some functions in SQL, the program will complain, according to the program's error information to modify the relevant place. There are mainly two places to modify:
The now () function in the SQL statement:
Use the now () function in access to get the current time, and the GETDATE () function in SQL Server to get the current time. However, since the original program was written in VB Script, VBScript also uses the now () function to get the current time, so beware of the first parameter of the DATEDIFF function in the SQL statement:
The first parameter DateDiff in Access is quoted, and only one letter is used to represent the comparison, while in SQL Server, quotes are not required and are represented in full and or short names, and the abbreviation is also two letters.
After the change, test-by-item, correct all errors (very simple).
The program can be used normally, before and after time may take 4 hours.
I think of the following points:
1, if we want to use Access database, in order to facilitate the migration later, we should try to avoid the use of database functions, but more use of programming language functions, in the SQL statement outside the solution of the calculation problem. If you do not want to avoid using these database functions, we should also set an obvious annotation tag in our code to facilitate migration later.
2. When we design the program, to fully consider the need for database migration, when inserting statements, query statements, and other statements to try to use the standard SQL syntax, and to take the trouble to insert the default value, rather than relying on the database to provide default values, this may be beneficial to future improvements.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.