Things to note When Access turns to SQL Server

Source: Internet
Author: User
Tags add date datetime functions numeric sql access database access
About Access database conversion to SQL database after the problem is quite a lot, so today the author in China's professional webmaster network is necessary to tell you about access to SQL related considerations:
1, after the database import, automatically add fields need to rewrite, all the number types need to increase the length, preferably in decimal.
2, all default values are lost. Mainly numeric types and date types.
3, all now (), time (), date () to be changed to GETDATE ().
4, all DateDiff (' d ', time1, time2) to be converted to DateDiff (day, time1, time2)
5, it is possible that some true/false types can not be used, to become 1/0.
6. The memo type is to be used by cast (column as varchar).
7, CursorType to be changed to 1, that is, to open the database to give the first numeric parameter of 1, otherwise the record may not show complete.
8, IsNull (RowName) to be changed to RowName = NULL
9, the automatic numbering type in the database of access when converting, SQL Server does not set it to AutoNumber, we need to add identity in the SQL creation statement, to indicate automatic numbering!
10. When converting, date-related fields, SQL Server defaults to smalldatetime type, we'd better turn it into a datetime type, because the range of datetime is larger than the smalldatetime type. Sometimes when using a smalldatetime type, the transformation fails, and when the datetime type is used, the conversion succeeds.
11. The SQL statements that operate on the two databases are not identical, for example: "Delete * from user where id=10" is used when deleting records for an Access database, and the SQL Server database is deleted by: "Delete user Where id=10 ".
12, the date function is different, in the Access database processing, available date (), Time (), and other functions, but for SQL Server database processing, can only use DateDiff, DATEADD and other functions, but not the date (), time () and other functions.
13, in the Access database processing, SQL statements can be directly used in some VB functions, such as the CStr () function, and SQL Server database processing, but can not be used.

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.