简体   繁体   English

使用SQL Server 2005导出表

[英]Export a table with SQL Server 2005

I'm not able to find in SQL Server 2005 the utility that phpmyadmin has for exporting tables. 我无法在SQL Server 2005中找到phpmyadmin用于导出表的实用程序。

My case is: 我的情况是:

I have an small table (20 rows) and I need to delete some columns I won't need. 我有一个小桌子(20行),我需要删除一些我不需要的列。

So I need a way to dump all info the table contains in an insert query. 所以我需要一种方法来转储表包含在插入查询中的所有信息。 Then, editing this query I just need to delete the columns I don't need and later I can delete the table and create it again filling it with the edited insert query. 然后,编辑此查询我只需要删除我不需要的列,然后我可以删除该表并再次创建它,并使用已编辑的插入查询填充它。

How can I do that with SQL Server 2005? 我怎么能用SQL Server 2005做到这一点?

Rather than exporting, dropping, recreating and repopulating the table, why not simply drop each of the unwanted columns: 而不是导出,删除,重新创建和重新填充表,为什么不简单地删除每个不需要的列:

ALTER TABLE TableName DROP COLUMN ColumnName;

Further details here . 更多细节在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM