Some experience of access to MSSQL database

Source: Internet
Author: User
Tags date datetime functions mssql access database access

Automatic numbering type in 1.ACCESS database when converting, SQL Server does not set it to AutoNumber, we need to add identity to the SQL creation statement to indicate AutoNumber.

AutoNumber fields become Non-null fields, which must be manually modified and labeled with a seed of 1 and an increment of 1.

2. When converting, date-related fields, SQL Server defaults to smalldatetime type, we'd better turn it into a datetime, because the range of datetime is larger than the smalldatetime type. I met this situation, with the smalldatetime type, conversion failure, but with the DateTime type, conversion success.

3. The SQL statements that operate on both databases are not identical, for example, when a record is deleted for an Access database: Delete * from user where id=10, and the SQL Server database is deleted by: delete user where id=10.

4. The date function is different, in the Access database processing, you can use the date (), Time (), and other functions, but in the SQL Server database processing, only datediff,dateadd functions, but not the date (), time () and other functions.

5. In Access database processing, SQL statements can be directly used in some VB functions, such as the CStr () function, but for SQL Server database processing, but not used.



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.