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轩 阅读(856) 评论(0) 推荐(0) 编辑