摘要:
create table tb(no int,b varchar(10))insert into tb select 1,'2' union all select 1,'3'union all select 1,'4'union all select 2,'5'union all select 2,'6' union all select 2,'7'gocreate function dbo.fc... 阅读全文
摘要:
Create Function f_getid()Returns Varchar(13)AsBeginDeclare @id varchar(13),@dt varchar(8)Select @dt=dt From v_getdateSelect @id=max(id) From tb Where id like @dt+'%'IF @id Is nullSet @id=@dt+'0001'Els... 阅读全文
摘要:
create table test(id varchar(18), --流水号,日期(8位)+时间(4位)+流水号(4位)name varchar(10) --其他字段)go--创建生成流水号的触发器create trigger t_inserton testINSTEAD OF insertasdeclare @id varchar(18),@id1 int,@head varchar(12)s... 阅读全文