Get the App
SLTechnology News&Howtos  ›  Database  › 

How to copy table structure and data in sql

Shulou Source: shulou.com Published: 2022-05-31 19:25:41 10月04日 Update

Sql how to copy table structure and data, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Use SELECT in SQL SERVER. INTO statements can be divided into the following categories according to their usage: 1. Achieve full table backup: for example: SELECT * INOT T1 FROM titles 2. Backup part of the table column (list written without *) or part of the row (with WHERE conditions) such as: SELECT title_id,title,price INTO T2 FROM titles- partial column SELECT * INTO T2 FROM titles WHREE price > 10-partial row SELECT title_id,title Price INTO T2 FROM titles WHREE price > 10-partial rows and columns 3. Only copy the structure of the table: for example: SELECT * INOT T1 FROM titles WHERE 1 # 24. Query results come from multiple tables: for example: SELECT title_id,title,pub_name INTO T3 FROM titles t INNER JOIN publishers p ON t.pub_id=p.pub_id 5.select * into to copy to the database name. DBO. Table name from original database name. DBO. Table name

After reading the above, have you mastered how to copy the table structure and data in sql? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Data structure content backup database method more part problem helpless for this reason reason situation multiple for this skills conditions sources articles experience Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux vpn Apple Shulou Information