时间:2021-07-01 10:21:17 帮助过:2人阅读
批量插入数据:
declare @i int set @i = 12 while @i < 14 begin INSERT INTO [mdm1220].[dbo].[DEVICE] ([SERIAL_NUMBER] ,[IMEI] ,[WIFI_MAC_ADDR] ,[BLUETOOTH_MAC_ADDR] ,[ACTIVESYNC_ID] ,[STRONG_ID] ,[LAST_INVENTORY_TIME] ,[FIRST_CONNECTION_DATE] ,[LAST_AUTH_DATE] ,[LAST_USERNAME] ,[LAST_PROFILE_INVENT_TIME] ,[OS_FAMILY] ,[LAST_USER_ID] ,[WHITELIST_COMPLIANT] ,[BLACKLIST_COMPLIANT] ,[DEVICE_PROPERTIES_TIMESTAMP] ,[ALL_WHITELIST_COMPLIANT] ,[LAST_ACTIVITY] ,[MANAGED] ,[COOKIE_TOKEN] ,[COOKIE_EXP] ,[SHARED_STATUS] ,[PROFILE_STATUS]) VALUES (@i ,‘35 698206 450366 6‘ ,‘64:9A:BE:85:7E:81‘ ,‘64:9A:BE:85:75:67‘ ,‘2TQ3F2Q4VT69V447KFOP7REQQ4‘ ,‘CF8Q44AA‘ ,‘2015-12-31 01:03:07.993‘ ,‘2015-12-30 23:08:30.497‘ ,‘2015-12-31 01:03:08.323‘ ,‘huifu2@worx.net "huifu2 wen"‘ ,‘2015-12-31 01:03:08.243‘ ,‘ANDROID‘ ,11 ,1 ,1 ,‘2015-12-30 23:09:38.317‘ ,1 ,‘2015-12-31 01:03:08.323‘ ,1 ,NULL ,NULL ,0 ,0 ) set @i = @i + 1 end
更新数据
declare @i int set @i = 1 while @i < 14 begin UPDATE [mdm1220].[dbo].[DEVICE] SET ACTIVESYNC_ID = ‘ActiveSyncChangedFOP7REQQ4‘ WHERE ACTIVESYNC_ID = ‘2TQ3F2Q4VT69V447KFOP7REQQ4‘ set @i = @i + 1 end
SQL 批量插入和更改数据
标签:sql