有关identity

awjx 2003-08-21 05:34:30
select identity(int,1,1)as mid,* into #temp from table1
where ID=@ID

但提示ID已经有identity属性,也就是说上面的语句存在问题,请问怎么办呢?
这段时间我发帖比较多,大力兄是这样回答我的
select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表
select * from #temp where ID_Num between 10 and 20


所以我想大力兄或各位高手讲讲,
对于identity我略知一二,但碰到上述问题我不知怎办?
...全文
41 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengdali 2003-08-21
  • 打赏
  • 举报
回复
select IDENTITY(int, 1,1) AS ID_Num,cast(你原来有的id as int) id,其他列 into #temp from 表
select * from #temp where ID_Num between 10 and 20
pengdali 2003-08-21
  • 打赏
  • 举报
回复
lect IDENTITY(int, 1,1) AS ID_Num,cast(你原来有的id as int) id,其他列 into #temp from 表
select * from #temp where ID_Num between 10 and 20

22,207

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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