Home > Database > Mysql Tutorial > 生成按日期编码的编码格式 SQL语句

生成按日期编码的编码格式 SQL语句

WBOY
Release: 2016-06-07 17:48:03
Original
1413 people have browsed it

生成按日期编码的编码格式 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";

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template