现有数据 01 02 03 。。。。
需要插入另一数据库中为 ‘01’,‘02’,'03' .... 需哟如何处理
或是插入后批量能更新也可,谢谢
------解决方案--------------------
- SQL code
insert into tb(col) select '''01'''
------解决方案--------------------
- SQL code
select '''name1'''--1select ''name1'' --2select 'name1' --3
------解决方案--------------------
- SQL code
-- 更新update tb set col1= ''''+ col1 + '''';
------解决方案--------------------
insert table B(field) select '''' + fieldname + '''' from table A
------解决方案--------------------
4楼的 应该满足你的要求
------解决方案--------------------
仅供参考:
- SQL code
CREATE TABLE t1( id VARCHAR(5))DECLARE @str VARCHAR(2000)='01 02 03'SET @str=REPLACE(@str,' ',''''''' union all select ''''''')SET @str='insert into t1 select [email protected]+''''''''PRINT @strEXEC (@str)SELECT * FROM t1---------------id'01''02''03'