今天原本是要将数据库中的表导出来,,可我的导入导出工具没法安装。
另则他法吧:
运行:proc_insert 'tablename'
再运行上述所得的结果:
select 'insert t_balance_office (id,name,address,parent_code,company,x,y) values ( '+case when id is null then 'NULL' else convert(varchar(11),id) end+','+case when name is null then 'NULL' else ''''+replace(name,'''','''''')+'''' end+','+case when address is null then 'NULL' else ''''+replace(address,'''','''''')+'''' end+','+case when parent_code is null then 'NULL' else ''''+replace(parent_code,'''','''''')+'''' end+','+case when company is null then 'NULL' else ''''+replace(company,'''','''''')+'''' end+','+case when x is null then 'NULL' else convert(varchar(23),x,2) end+','+case when y is null then 'NULL' else convert(varchar(23),y,2) end+')' from t_balance_office
可以看到如下结果:
(这个图片也不知道怎么搞)
在结果上点击右键--选择select all在点击右键选择copy。
这样你就得到了insert语句
当无法使用工具进行数据库表的导出时,可以通过编写SQL语句实现手动导出。具体步骤包括运行特定过程以获取插入语句,然后复制这些语句以供进一步使用。
7469

被折叠的 条评论
为什么被折叠?



