SQL Server:如何导入Excel创建表? [英] SQL Server : how to import Excel to create a table?
问题描述
a清楚的指导如何实现这一点以及如何设置SQL Server。
具有三列的Excel文件是这样的:
ItemCode描述价格
a01苹果10
a02橙色20
a03菠萝10
a04火30
a05 tim 35
a06 keny 25
a07 peter 20
a08 tom 21
a09鼠标23
a10键盘45
我正在使用SQL Server 2008 Express版本。但是我在安装过程中跳过了一些事情,如失败的PerfMonCounterNotCorruptedCheck。任何方式我完成安装。
我去导入/导出到SQL Server,我从Excel中选择源,并将目标服务器像SQL Server Native Client和服务器设置为 CNG9130xxxx
。它显示从Excel导入的记录从表中成功形成数据库中的表。但是,在我关闭之后,我找不到新创建的数据库文件,我应该在哪里输入SQL命令来提取一些数据列表,表示Price< 21
<任何想法?
或者我应该去像SQL Server 2014 Express那样的更新版本?
提前感谢
如果您使用SQL Server Management Studio,请按照下列步骤操作:
- 从SQl Server Mgmt的对象资源管理器。 Studio,右键单击您的数据库名称。
- 选择任务>导入数据
- 在SQL Server导入和导出向导中,选择
Microsofrt Excel
.Next - 将目标设置为
SQL Server Native Client 11.0
。 - 输入您的
服务器名称
,验证
,数据库
。 - 选择
从一个或多个表或视图复制数据
。下一步 - 选择excel的工作表名称,然后从右侧列修改表名称。
- 立即显示。
您的新表可以使用了。 >
I am really new to database management. What I expect from this question is a clear guideline on how to achieve this and how to set up SQL Server.
The Excel file with three columns is like this:
ItemCode Description Price
a01 apple 10
a02 orange 20
a03 pineapple 10
a04 fire 30
a05 tim 35
a06 keny 25
a07 peter 20
a08 tom 21
a09 mouse 23
a10 keyboard 45
I am using SQL Server 2008 Express edition. But I skip some things during installation like "Failed PerfMonCounterNotCorruptedCheck". Any way I completed the installation.
I go to import/export into SQL Server, I choose source from Excel and set the destination server like "SQL Server Native Client" and server to CNG9130xxxx
. It shows the records from Excel is imported to form a table in database to from table successfully. But, after I hit close, I just can not locate the newly-created database file and where should I type SQL command to extract some data list says the list of Price<21
Any ideas?
Or should I go for some later version like SQL Server 2014 Express?
Thanks in advance
If you are using SQL Server Management Studio, then follow these Steps:
- From the object explorer of SQl Server Mgmt. Studio, right click on your database name.
- Select Tasks > Import Data
- In SQL Server Import and Export Wizard, Select
Microsofrt Excel
.Next - Set Destination as
SQL Server Native Client 11.0
. - Enter your
Server Name
,Authentication
,Database
. Next - Select
Copy data from one or more table or views
. Next - Select the sheet name of your excel and modify the table name from right side column. Next.
- Excecute immediately.
Your new table is ready to use.
这篇关于SQL Server:如何导入Excel创建表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!