nick轩

导航

2012年3月8日 #

SQL Server 循环,左侧不足位补零

摘要: declare @i int set @i=1 while @i <101 begin INSERT INTO [TMS_V4].[dbo].[TB_GPSDeviceInfo] ([DeviceCode] ,[CompanyCode] ,[Status] ,[Remarks] ,[CreateUserName] ,[CreateBy] ,[CreateOn]) select 'KLD'+right('000'+ltrim(@i),3) ,'SZKLD',1,'','SYSTEM','SYSTEM&# 阅读全文

posted @ 2012-03-08 12:02 nick轩 阅读(839) 评论(0) 推荐(0) 编辑