更新记录?

数据里有个sn(nvarchar(10))字段,
我想让他的第一个直为
10000000,
10001000
10002000
10003000
10004000
。。。。
sql语句怎么写
---------------------------------------------------------------

select identity(int,10000000,1000) as 'f1',a.f2, a.f3, ... into t2 from t1 a
---------------------------------------------------------------

select filedname1,identity(int,1000000000,1000) as sn into #temp from table
update table set sn=a.sn from #temp where table.filedname1=a.fieldname1

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus