很简单的问题,哎~~~

fireworksloveyou 2007-08-09 11:13:14
怎么把一个表的数据插入到另一张表里面 字段完全相同
如:
我想把表 A 的前100条数据插入到表B
A(sj,rw,dd)
B (sj,rw,dd)
字段完全相同
...全文
185 16 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
fireworksloveyou 2007-08-09
  • 打赏
  • 举报
回复
CREATE procedure project_select
@address nvarchar(60)
as
select * from 重庆 where address like '%' + @address + '%'
GO

如果我要返回模糊查询后的记录条数应该怎么写哦 最后一个问题了
paoluo 2007-08-09
  • 打赏
  • 举报
回复
CREATE procedure project_select
@address nvarchar(60)
as

select * from 重庆 where address like '%' + @address + '%'
GO
fireworksloveyou 2007-08-09
  • 打赏
  • 举报
回复
现在我的数据量特别大 我怎么在存储过程成使用模糊查询呢
如:CREATE procedure project_select
@address nvarchar(60)
as

select * from 重庆 where address like %@address% 这个地方怎么处理
GO
livan1038 2007-08-09
  • 打赏
  • 举报
回复
insert into b select top 100 * from a
  • 打赏
  • 举报
回复
insert table1
select top 100 * from table2
QQMagicer 2007-08-09
  • 打赏
  • 举报
回复
insert into b
select top 100 *
from a
肥胖的柠檬 2007-08-09
  • 打赏
  • 举报
回复
insert into table1
select top 100 * from table2 --楼上的少了个top 100
paoluo 2007-08-09
  • 打赏
  • 举报
回复
ruihuahan(飞不起来的笨鸟),掉了TOP
paoluo 2007-08-09
  • 打赏
  • 举报
回复
Insert B Select TOP 100 * From A
ruihuahan 2007-08-09
  • 打赏
  • 举报
回复
insert into table1 select * from table2
pengxuan 2007-08-09
  • 打赏
  • 举报
回复
insert into b select top 100 * from a
paoluo 2007-08-09
  • 打赏
  • 举报
回复
fireworksloveyou() ( ) 信誉:100 2007-8-9 12:58:18 得分: 0



CREATE procedure project_select
@address nvarchar(60)
as
select * from 重庆 where address like '%' + @address + '%'
GO

如果我要返回模糊查询后的记录条数应该怎么写哦 最后一个问题了

----------------------------------------

CREATE procedure project_select
@address nvarchar(60),
@count Int Output
as
select @count = Count(*) from 重庆 where address like '%' + @address + '%'
GO
--調用
Declare @count Int
EXEC project_select 'A', @count Output
Select @count
mojian0820 2007-08-09
  • 打赏
  • 举报
回复
定义个输出参数比如 a out numeric
select count(*) into a from 重庆 where address like '%' + @address + '%'
liangyuan198412 2007-08-09
  • 打赏
  • 举报
回复
insert into b select top 100 * from a order by ...
fa_ge 2007-08-09
  • 打赏
  • 举报
回复
insert into b select top 100 * from a
gjchjw 2007-08-09
  • 打赏
  • 举报
回复
insert into table1
select top 100 * from table2

34,837

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧