北邮数据库实验报告(3) 下载本文

数据库实验报告(三)

姓名:学号:班级:

1. 用Transact-SQL语句、数据导入、SQL Server Management Studio(企业管理器)输入的方法对所给定的8张表的数据输入到数据库中。自行决定每张表的数据导入办法,但每种方法各针对二或三张表。

? Transact-SQL语句:

导入department,student, student_course表。

insertinto department select*from openrowset

('microsoft.jep.oledb.4.0','excel 5.0;hdr=yes;database=D:\\课件\\数据库\\database2.xls',department$);

insertinto student select*from openrowset

('microsoft.jep.oledb.4.0','excel 5.0;hdr=yes;database=D:\\课件\\数据库\\database2.xls',student$);

insertinto student_course select*from openrowset

('microsoft.jep.oledb.4.0','excel 5.0;hdr=yes;database=D:\\课件\\数据库\\database2.xls',student_course$);

? 数据导入:

操作:选中数据库studentsdb,右键-任务-导入数据。 导入book, class, course表。