Home >Database >Mysql Tutorial >生成按日期编码的编码格式 SQL语句
生成按日期编码的编码格式 sql语句
sqlparameter[] parameters = {
new sqlparameter("@dateday", sqldbtype.nvarchar,10)
};
parameters[0].value = system.datetime.now.tostring("yymmdd");
string strsql = @"declare @id nvarchar(20)
select @id=isnull(max(cast(right(id,5) as int)),0)+1
from chicrwh.storehouse.inwarehouse with(nolock)
where charindex(@dateday, id)=2
set @id='b'+@dateday+right() select @id";