要輸入數據到SQL Server創建的表中,可以使用以下方法之一:
INSERT INTO table_name (column1, column2, column3) VALUES (value1, value2, value3);
示例:
INSERT INTO employees (first_name, last_name, age) VALUES ('John', 'Doe', 25);
INSERT INTO table_name (column1, column2, column3) VALUES (value1, value2, value3), (value4, value5, value6), ...;
示例:
INSERT INTO employees (first_name, last_name, age) VALUES ('John', 'Doe', 25), ('Jane', 'Smith', 30), ('Mike', 'Johnson', 35);
INSERT INTO table_name (column1, column2, column3) SELECT value1, value2, value3 FROM another_table;
示例:
INSERT INTO employees (first_name, last_name, age) SELECT first_name, last_name, age FROM another_table;
請確保在INSERT語句中提供與表定義中的列相對應的值,以及正確的數據類型和格式。