06
11/11
SQL生成流水号
--生成流水号--创建测试表create table test(id varchar(18), --流水号,日期(8位)+时间(4位)+流水号(4位)name varchar(10) --其他字段)go--创建生成流水号的触发器create trigger t_insert on testINSTEAD OF insertasdeclare @id varchar(18),@id1 int,@head varchar(12)select * into #tb from insertedset @head=convert(varchar,getdate(),112)+replace(convert(varchar(5),getdate(),108),':','')select @id=max(id) from test where id like @head+'%'if @id is nullset @id1=0elseset @id1=cast(substring...