Problems with importing large amounts of data into SQL databases

Updated on technology 2024-04-10
7 answers
  1. Anonymous users2024-02-07

    You've fallen into a trap you've set yourself.

    Your problem can be solved, but it's not very efficient.

    1. After each insertion of a piece of data for a period of time);

    Give the thread a break, and there won't be a problem with the database not keeping up2It's not that the cache is not cleared, but that the response is slow due to the large amount of data, and program optimization is the key.

    After the insertion action is executed, if it is successful, it will be deleted from the datalist.

    Give you a new idea.

    sqlserver supports SQL file data import. That is, if you have a *If the SQL file is insert into, you can import all the data in it.

    c#..net file operation is still very simple.

    Therefore, it is recommended to generate an SQL file after reading XML, and after reading the next XML, append the content in the middle to that SQL, and finally execute it uniformly. So that these two of your problems don't arise.

  2. Anonymous users2024-02-06

    Set the primary key to an automatic sequence. Then upload an access database to the server first, and insert the data on the server into the access. Then bring the access ** down.

    Use the data source of the XP system to convert the access data to the sqlserver. That's it.

    As for the fact that a lot of data cannot be inserted at once, there are many ways to solve it. Tell you a simple one.

    Use this marker to pause for 5 seconds to jump. You can use a session to record the current fetched XML data to the first page. Then, the next time you jump, the number of pages in the session will be increased by 1.

  3. Anonymous users2024-02-05

    <> "Third: Put the two files in the root directory.

    Fourth: Open the windows command and run sqlldr userid=username password@database control=

    Fifth, the execution result will be written to the log table in the execution window and the root directory, and if there is an error, it will be written. bad file.

    <>Sixth: Successfully import data display.

  4. Anonymous users2024-02-04

    The second problem I encountered once, but that was when I didn't close the database connection, if I didn't actively close the database connection after inserting it, I won't have this problem, you may have the number of database connections has reached the maximum number of SQL Server connections, you can check it.

  5. Anonymous users2024-02-03

    This problem can be dealt with in the following way:

    1. Clear the logs with backup log database with no log.

    Changing the failback model in the first regret database properties to "simple acceptance" can greatly slow down the rate of log growth.

    After the backup log database with no log is named, the inactivity log will be truncated, and the size of the physical log file will not be reduced, but the logical log will be reduced, and the inactive virtual log will be deleted after the database is contracted to free up space and will not damage the data.

    If the logs are truncated and the database is shrunk, you cannot directly use the most recent full database backup for point-in-time restoration.

    2. When SQL Server is running, delete the transaction log file of the main database of Dongqinji, and the steps are as follows:

    1) Detach the database manager database and right-click the database you want to delete the log All Tasks to detach the database.

    2) Then delete the log file.

    3) and then attach the database.

    Enterprise Manager Databases Right-click on databases All Tasks Only mdf. is attached when attaching a database

    3. Detailed methods for compressing SQL databases and logs.

    You can select the "auto shrink" option in the database properties options to have the system compress the database automatically, or you can compress it manually.

  6. Anonymous users2024-02-02

    You're talking about importing via SQL! It is generally determined by the following methods:

    1. Modify the server upload file limit, generally the default socks mu calendar is 2m2, directly copy the files under mysq data to the corresponding place on the server.

    3. Search and divide SQL files, and execute them in batches.

    Answer, support me.

  7. Anonymous users2024-02-01

    Do not use a backup database to generate an insert statement from the database and execute it in batches.

Related questions
3 answers2024-04-10

At least the basic things must be mastered, such as: the linear structure of the database, the storage method, the way to call Hezheng, and the operation of the table in the database (to use statements to erect the bench to achieve). >>>More

5 answers2024-04-10

Enterprise Manager Create a database in SQL Select All Tasks Import Data Select Microsoft Access from Data Source When importing the Access database to the MSSQL database, there are several issues that should be paid attention to When using MSSQL Server, there are many differences with Access, even if you use SQL Server to import the Access database, there are many places to pay attention to. 1. After importing the auto-numbering field often used in Access, it is not an auto-incrementing int, and it needs to be manually set to change the "no" of the imported auto-numbering field to "yes", and the "seed" and "increment" are both "1" in order to become an auto-number; 2. In MSSQL Server, there are many reserved words, which are not available in Access, and when you import data into MSSQL, the problem will come out. MSSQL will automatically add "[field name]" to these fields (including the table names in the database) when importing, so you must modify your script to add parentheses to the corresponding field names (or table names), or change the field names to non-MSSQL reserved words. >>>More

6 answers2024-04-10

The prospect of learning UI is good, and there are many training institutions, so the local people may choose to visit and understand the real teachers and educational strength of the school before making a choice. Share the general development of the UI, I hope it will be useful to you. >>>More

10 answers2024-04-10

The database is generally composed of many tables, for example, the school builds a database, which can build a student table (including the student's name, age, student number, class, date of birth), a teacher table (including the teacher's name, age, teaching class, teaching category), a report sheet (including the student's student number, and the grades of each subject), etc. These are the ways in which the files are stored in the database, and try to make sure that the items in a table are closely related and have the same attributes, if this condition cannot be met, a table must be built (the redundancy of the built table has 4 levels). In order to meet the user's query needs, we also need to make a number of views, for example, you can make a view of his items have the name of the student, age, grades of each subject, and the teacher of each subject, etc., we can also export new items according to the existing items, for the purpose of simplicity, for example, the view can add an average grade, we add different permissions and roles to each view, and provide it to different people to query to protect the security of the database. >>>More

10 answers2024-04-10

The steps to uninstall the SQL Server database are as follows: >>>More