如何截断SQL Server表数据 [英] how to truncate sql server table data

查看:84
本文介绍了如何截断SQL Server表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功地使用sqlbulk复制代码将excel文件导入到sql服务器表中...但是我如何刷新表中的数据...当我下次导入excel文件时...请任何人告诉我代码...

i suceessfuly imports the excel file into the sql server table using sqlbulk copy code... but how can i refresh the data from the table...when i import the excel file next time... plz anyone tell me the code...

推荐答案

使用Truncate ^ ]删除表,然后将所有内容从excel再次导入到该表中.

Truncate将清空表,因此您必须记住编写自己的逻辑,以防某些记录(在导出后)仍保留在表中.
Use the Truncate keyword[^] to remove the table and then import everything from excel into this table again.

Truncate will empty out the table, so you must remember to write your own logic in case you want some records to still remain in the table (after an export).


这篇关于如何截断SQL Server表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆