[Database Study Notes] (3) ing between SQL data types and Java data types, learning notes Data Types

Source: Internet
Author: User

[Database Study Notes] (3) ing between SQL data types and Java data types, learning notes Data Types

Comparison of Data Types Between SQL database and access Database

Text nvarchar (n)

Note ntext

Number (long integer) int

Integer smallint

Number (single precision) real

Number (Double Precision) float

Number (byte) tinyint

Currency money

Date smalldatetime


Ing between SQL server and access Data Types,

Convert ACCESS to SQL database

Many of my friends want to use the SQL2000 database programming method, but they suffer from learning ACCESS, just a little understanding of SQL, here I will provide you with the following reference-methods and precautions for converting ACCESS into SQL2000
I. First of all, I am talking about the conversion between ACCESS2000 and SQL2000. I have not tried any other products yet. I hope you can experiment more and find a solution;
Ii. Conversion Method
1. Open "database source" in "Management Tools" under "Control Panel";
2. Press "add" to add a new data source, and select "Driver do microsoft Access" in the selection bar.
(*. Mdb) ", a box will appear after completion,

Enter the name you want to write in "database source". My name is "ABC", which means you do not need to enter it. Next, select the name as follows, find your database address and select it (Note: Back up your own ACCESS database first), and then confirm.
The data source is created here, and the conversion is left.

3. Open SQL2000 Enterprise Manager, enter the database, and create an empty Database "ABC ";
4. Select the new database, right-click the database, select "import data" under "all tasks", and click "Next;
5. Select "Driver do microsoft Access (*. mdb) ", in" User/system DSN ", select the" ABC "you just added and press" Next ";
6. The "destination" does not need to be modified. You can select a server (generally "local" for your local machine) or a server address or LAN address, determine whether your permissions can be operated.) "using WINDOWS Identity Authentication" means using your system administrator identity. "using SQL Identity Authentication" can be used for website operations, the latter is recommended;
7. After selecting "use SQL authentication", enter your username and password. I chose the default system number "sa", "***", select the newly created "ABC" for the database and press "Next".
8. Select "Copy table and view from data source" and "use a query command to specify the data to be transmitted", select the former, and press "Next" to continue;
9. here you will see your own ACCESS database table. After you press "select all", next step;
10. In the "DTS import/export wizard", see "Run now" and press "Next",
11. Press "finish" to continue;
12. In this step, you will see that your data has been imported into SQL2000. When "XXX tables have been successfully imported into the database" appears, in addition, if there is a green check in front of all tables, it means that all data is successfully imported. If there is a problem in the middle or there is a red cross in front of the table, it means that the table has not been imported successfully, in this case, you have to go back and check whether your operations are correct.

3. data modification
1. Because SQL2000 does not contain "automatic number", all fields you set with "automatic number" will become non-empty fields, which must be manually modified, and select "yes" for his "mark", the seed is "1", and the increment is "1",
2. In addition, after ACCESS2000 is converted to SQL2000, the field with the original attribute "yes/no" will be converted to a non-empty "bit", at this time, you must modify it to the desired attribute;
3. In addition, you should be aware of the time functions. ACCESS and SQL are different.

What should I pay attention to when changing ACCESS to SQL?

After the database is imported, fields that need to be automatically added must be overwritten, and the length of all numeric types must be increased. It is best to use decimal.

All default values are lost. It mainly belongs to the numeric type and date type.

All now (), time (), date () must be changed to getdate ().

Change all datediff ('D', time1, time2) to datediff (day, time1, time2)

There may be some true/false types that cannot be used. You need to... the remaining full text>

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.