VBScript code: conn.execute("SET IDENTITY_INSERT [abc] On" & vbcrlf & "insert into [abc] (id,name,qq,msn) select (select top 1 id from [abc] order by id desc)+1,name,qq,msn) from [abc] where id="&sid&" & vbcrlf & "SET IDENTITY_Insert [abc] OFF")
这样可以复制新的一行,但是如果有很多用户同时使用,如果并发的话,这里面的select top 1肯定就不对了?
select id,name,type from A union all select id,name,type from B union all select id,name,type from C union all where ??? ---------------------------------------------------- ......
我建立类似这样的存储过程 SQL code: CREATE PROCEDURE pro @var sysname AS if @var='a' select * into #mb from mb else if @var= 'b' select * into #mb from mb 提示错误2714:数据库中已 ......