SQL BULK INSERT and change data

Source: Internet
Author: User
Tags bulk insert

To insert data in bulk:

declare @i intset @i = 12 while @i < 14begin insert  INTO&NBSP;[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]    & nbsp;      ,[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]  &Nbsp;        ,[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 '             , ' [Email protected]&nbSP; " 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 + 1end

Update data

DECLARE @i intset @i = 1 while @i < 14begin UPDATE [mdm1220]. [dbo].   [DEVICE] Set activesync_id = ' Activesyncchangedfop7reqq4 ' WHERE activesync_id = ' 2tq3f2q4vt69v447kfop7reqq4 ' Set @i = @i + 1en D


SQL BULK INSERT and change data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.