摘要: 之前仅仅用select count(*)+1 counts from table,今天保存数据是报唯一键约束,又搞了个方法:select isnull(max(convert(int,ID))+1,0) from table,希望能解决。如果要求ID前加个字母,如'E123',则使用:select 'E'+convert(varchar(15),isnull(max(convert(int,sub... 阅读全文
posted @ 2009-06-29 18:23 鱼肚白 阅读(220) 评论(0) 推荐(0) 编辑