摘要:
DECLARE @sonumber BIGINTSELECT @sonumber=CONVERT(BIGINT, @serverId + Substring(CONVERT(VARCHAR(4), Datepart(yy, Getdate())), 4, 1) + Substring(CONVERT(VARCHAR(10), Getdate(),12),3,6) + CONVERT(VARCHAR(100), CAST( Rand()*(999999 -100000)+100000 AS DECIMAL( 38, 0)))) SELECT @sonumber AS id可以用一个表去维护,当. 阅读全文