declare @area varchar(20)
declare @sql varchar(1000)
declare @table1 varchar(20)
declare @table2 varchar(20)
set @table1='4xz'
set @table2='xz4'
set @area='郁闷'
set @sql='insert into ['+@table1+'] (tel) select col001 from ['+@table2+'] where substring(col001,1,7) in(select tel from area_tel where area='''+@area+''')'
exec(@sql)
insert into [4xz] (tel) select col001 from [xz4] where substring(col001,1,7) in(select tel from area_tel where area='郁闷')
declare @sql varchar(1000)
declare @table1 varchar(20)
declare @table2 varchar(20)
set @table1='4xz'
set @table2='xz4'
set @area='郁闷'
set @sql='insert into ['+@table1+'] (tel) select col001 from ['+@table2+'] where substring(col001,1,7) in(select tel from area_tel where area='''+@area+''')'
exec(@sql)
insert into [4xz] (tel) select col001 from [xz4] where substring(col001,1,7) in(select tel from area_tel where area='郁闷')
解决方案 »
- showplan
- 我的 VS 2010 怎么没有安装部署项目 模板?
- 关于sql2000自动生成数据表
- 这句SQL字符串应该怎么写
- 如何查出多个字段值相同的行
- 兄弟们帮忙一下小弟突然想不起来怎么查看表的约束 在企业管理器里面
- sqlserver2000中,怎样写大量数据的批量更新sql语句
- a DBA want to export the full database but the user still
- 十万火急!!!我用INSTALLSHELLIELD做的安装盘,为何不能在注册表上注册数据库???
- 请教各位高手,如何不用数据捆绑而调用Foxpro的dbf文件?
- 有关自定义函数的问题
- 数据查询超时问题!! 高分求助
insert into [4xz] (tel) select col001 from [xz4] where substring(col001,1,7) in(select tel from area_tel where area='郁闷')